How to: Retrieve the Contents of the My Documents Directory in Visual Basic
The SpecialDirectories object can be used to read from many of the All Users directories, such as My Documents or Desktop.
To read from the My Documents folder
Use the
ReadAllText
method to read the text from each file in a specific directory. The following code specifies a directory and file and then usesReadAllText
to read them into the string namedpatients
.Dim path As String Dim patients As String path = My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\" & "Patients.txt" patients = My.Computer.FileSystem.ReadAllText(path)
See also
GitHub पर हमारे साथ सहयोग करें
इस सामग्री का स्रोत GitHub पर पाया जा सकता है, जहाँ आप समस्याएँ बना और समीक्षा भी कर सकते हैं और अनुरोध खींच सकते हैं. अधिक जानकारी के लिए, हमारे योगदानकर्ता गाइड देखें.