读取文本文件时,delphi(2010)程序冻结

我正在使用用户识别系统来不重复任何用户,但是在识别到冲突delphi时完全冻结

procedure TForm2.Button2Click(Sender: TObject);
  var cool : textfile ;
  svolunteer,scool,sline : string ;
  ipos : integer ;
begin
  svolunteer := string(edtname.text) + ' ' + string(edtAge.Text)  ;

  assignfile(cool,'cool.txt' )        ;
  try
    reset(cool)
  except
    ShowMessage('file not found') ;
    exit ;
  end;

  while not eof(cool) do
  begin
    reset(cool) ;
    readln(cool,scool) ;
    ipos := pos(',',sline)        ;
    scool := copy(sline,1,ipos -1 ) ;
    Delete( sLine,iPos -1);
    if svolunteer = scool then begin
      ShowMessage('username taken') ;
      closefile(cool)
    end;
  end;
  begin
    append(cool) ;
    writeln(cool,svolunteer) ;
    closefile(cool)             ;
  end;
  Button2.Enabled := false ;
end;

我已经等了几分钟,但似乎没有解决任何问题

cywmm 回答:读取文本文件时,delphi(2010)程序冻结

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3157586.html

大家都在问