......
implementation
uses unit1,iniFiles;{$R *.DFM}
procedure TForm2.BitBtn2Click(Sender: TObject);
var
  password:TIniFile;
  str:string;
begin
  try
  password:=TIniFile.create('c:\住房管理系统\password.ini');
  str:=password.ReadString('password',password,'');//系统提示错误行
  finally
  password.Free;
  if edit2.Text=str
  then begin
          application.ProcessMessages; //?
          Application.CreateForm(TForm1, Form1);
          form2.Hide;
          form2.Free;
          form1.Show;
          form1.Update; //?
       end
     else begin
            showmessage('住户登录口令错误,请重新输入 !!!');
            edit2.Clear;
            form2.ActiveControl:=edit2;
            bitbtn2.Enabled:=false;
          end;
end;
......
[Error] Unit2.pas(43): Incompatible types: 'String' and 'TIniFile'
[Error] Unit2.pas(65): Statement expected but 'PROCEDURE' found
[Fatal Error] Project1.dpr(19): Could not compile used unit 'Unit2.pas'

解决方案 »

  1.   

    var
      password:TIniFile;把你的这个变量改个名字试试,不要也叫做password
      

  2.   

    finally
      password.Free;
    end;          //此处加上end;格式
    try
     ....
    finally
     ...
    end;       //try也要end来结束的
      

  3.   

    begin
      try
        password:=TIniFile.create('c:\住房管理系统\password.ini');
        str:=password.ReadString('password',password,'');//系统提示错误行
      finally
        password.Free;
      end;
    ...
      

  4.   

    str:=password.ReadString('password',password,str);//系统提示错误行
      

  5.   

    要这样写的str:=password.ReadString('password','password','');//得有引号的
    再就 是象hnhb(不死鸟) 说的异常处理没有加end;