怎样打开ini文件,并进行读写?

解决方案 »

  1.   

    IniFile:=TIniFile.Create('F:\Borland\2000\Delphi6\WallPaperMaker.ini');    DirectDelete:=IniFile.ReadBool('name1','name2',true);
        STV.Path:=IniFile.ReadString('name3','Path',STV.SelectedFolder.PathName);
        MovePath:=IniFile.ReadString('name4','MovePath',MovePath);
        IniFIle.Free;ini 里是这个样子
    [name1]
    name2=1
    [name3]
    Path=D:\Documents and Settings\Administrator\桌面
    [name4]
    MovePath=C:\Documents and Settings\Administrator\My Documents\My Music对照着看应该能明白
      

  2.   

    IniFile:=TIniFile.Create('F:\Borland\2000\Delphi6\WallPaperMaker.ini');    IniFile.WriteBool('name1','name2',true);
        IniFile.WriteString('name3','Path',STV.SelectedFolder.PathName);
        IniFile.WriteString('name4','MovePath',MovePath);
        IniFIle.Free;这是写入ini的程序。格式也是上面那个样子
      

  3.   

    都说完了,还要加上uses inifiles;