function ReadFileText(byval FileName as string) as string dim hFile as integer dim a() as byte hFile = FreeFile() Open FileName for binary access read as #hFile Redim a(Lof(hFile)-1) Get #hFile,, a Close #hFile ReadFileText = StrConv(a, vbUnicode) end functionText1 = ReadFileText("C:\WINDOWS\vbaddin.ini")
Private Sub Form_Load() Open "C:\123.ini" For Input As #1 b = "" Do Until EOF(1) Line Input #1, nextline b = b & nextline & Chr(13) & Chr(10) Loop Close #1 Text1.Text = b Open "C:\123.Txt" For Output As #1 Print #1, , b Close #1End Sub
function ReadFileText(byval FileName as string) as string dim hFile as integer dim a() as byte hFile = FreeFile() Open FileName for binary access read as #hFile Redim a(Lof(hFile)-1) Get #hFile,, a Close #hFile ReadFileText = StrConv(a, vbUnicode) end functionText1 = ReadFileText("C:\WINDOWS\vbaddin.ini")
dim hFile as integer
dim a() as byte hFile = FreeFile()
Open FileName for binary access read as #hFile
Redim a(Lof(hFile)-1)
Get #hFile,, a
Close #hFile ReadFileText = StrConv(a, vbUnicode)
end functionText1 = ReadFileText("C:\WINDOWS\vbaddin.ini")
Open "C:\123.ini" For Input As #1
b = ""
Do Until EOF(1)
Line Input #1, nextline
b = b & nextline & Chr(13) & Chr(10)
Loop
Close #1
Text1.Text = b
Open "C:\123.Txt" For Output As #1
Print #1, , b
Close #1End Sub
Text1 = ReadFileText("C:\WINDOWS\vbaddin.ini")都写成这样了,还不会用吗?("C:\WINDOWS\vbaddin.ini")修改成你要读的ini文件路径+文件名
dim hFile as integer
dim a() as byte hFile = FreeFile()
Open FileName for binary access read as #hFile
Redim a(Lof(hFile)-1)
Get #hFile,, a
Close #hFile ReadFileText = StrConv(a, vbUnicode)
end functionText1 = ReadFileText("C:\WINDOWS\vbaddin.ini")
[要数周期]
周期= 5
[自动更换数据库]
是否=否
[设置软件标题名]
标题=XX市电力局电网远程无线监控系统不带格式的(也就纯文本文件)如:
tttt,xxxxx
1234,5678