Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Dim file = My.Computer.FileSystem.ReadAllText("file.txt", System.Text.Encoding.GetEncoding(1251))
Dim MyFile
Dim S As String
MyFile = FreeFile
Open ("C:TEST.txt") For Input As #MyFile
S = Input$(LOG(1), 1)
Close #MyFile
Open "c:\temp.txt" For Input As #1
Do Until EOF(1)
Line Input #1, txt
alltxt = alltxt + txt + vbCrLf
Loop
Close #1
txtText.Text = alltxt
Function ReadAllText(ByVal filename As String) As String
Set FSOObj = CreateObject("scripting.filesystemobject")
Set ts = FSOObj.OpenTextFile(filename, 1, True): ReadAllText = ts.ReadAll: ts.Close
Set ts = Nothing: Set FSOObj = Nothing
End Function
Function WriteAllText(ByVal filename As String, ByVal txt As String) As Boolean
On Error Resume Next: Err.Clear
Set FSOObj = CreateObject("scripting.filesystemobject")
Set ts = FSOObj.CreateTextFile(filename, True)
ts.Write txt: ts.Close
WriteAllText = Err = 0
Set ts = Nothing: Set FSOObj = Nothing
End Function