有个INI文件,里面有多行数据,如何将它的内容读到一个TEXT文档里,并显示出来,望把代码写出来

解决方案 »

  1.   

    直接将INI用TXT打开就可以啦.
      

  2.   

    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")
      

  3.   

    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
      

  4.   


    Text1 = ReadFileText("C:\WINDOWS\vbaddin.ini")都写成这样了,还不会用吗?("C:\WINDOWS\vbaddin.ini")修改成你要读的ini文件路径+文件名
      

  5.   

    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")
      

  6.   

    INI文件有INI文件格式吗,还是存文本的.带样式的如:
    [要数周期]
    周期= 5
    [自动更换数据库]
    是否=否
    [设置软件标题名]
    标题=XX市电力局电网远程无线监控系统不带格式的(也就纯文本文件)如:
    tttt,xxxxx
    1234,5678
      

  7.   

    楼主和 Clear_Zero 认识?