[UserPassWord]
PassWord=字符串怎么把这个关键字对应的字符串读出来?

解决方案 »

  1.   

      readString('UserPassWord','PassWord','sa')
    很简单的
      

  2.   

    with tinifile.Create(GetCurrentDir+'\dd.ini') do
    begin
    str:=WriteString('userpassword','password','')
    end;
      

  3.   

    最好把代码发上来,大家给你研究一下
    QQ群:45139318正在招管理员,http://topic.csdn.net/u/20070819/20/88faa044-1e4f-41f3-a895-633a967f7a19.html
    有意进本群与大家共同学习者也请加入!
      

  4.   

    研究一下下面的例子unit Unit1;
    interfaceuses
    Windows,Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, inifiles, StdCtrls, ExtCtrls;type
    TForm1=class(TForm)
    Edit1:TEdit;
    CheckBox1:TCheckBox;
    Edit2:TEdit;
    Label1:TLabel;
    Label2:TLabel;
    Timer1:TTimer;
    Label3:TLabel;
    procedureFormCreate(Sender:TObject);
    procedureFormDestroy(Sender:TObject);
    procedureTimer1Timer(Sender:TObject);private
    {Privatedeclarations}
    public
    {Publicdeclarations}
    end;var
    Form1:TForm1;implementation
    var
    myinifile :TInifile;
    ?
    {$R*.DFM}procedureTForm1.FormCreate(Sender:TObject);
    var
    filename:string;
    begin
    filename:=ExtractFilePath(paramstr(0))+'myini.ini';
    myinifile :=TInifile.Create(filename);
    edit1.Text:=myinifile.readstring ('程序参数','用户名称','缺省的用户名称');
    edit2.text:=inttostr(myinifile.readinteger('程序参数','已运行时间',0));
    checkbox1.Checked:=myinifile.readbool ('程序参数','是否正式用户',False);
    end;procedureTForm1.FormDestroy(Sender:TObject);
    begin
    myinifile.writestring('程序参数','用户名称',edit1.Text);
    myinifile.writeinteger('程序参数','已运行时间',strtoint(edit2.text));
    myinifile.writebool('程序参数','是否正式用户',checkbox1.Checked);
    myinifile.Destroy;
    end;
      

  5.   

    不要直接用Destroy,用Free才是的