在windows api 中有一个 readfile 函数,怎么用?
我想通过这个函数读取一个文本的内容。谢谢!

解决方案 »

  1.   

    I:=0
    repeat
    i:=I+1;
    readln(I);
    until i=10;
      

  2.   

    var
      file1:Textfile;
      v_str:string;
    begin
      OpenDialog1.InitialDir:=ExtractFilePath(application.ExeName);
      if OpenDialog1.Execute then
      begin
        assignfile(file1,OpenDialog1.FileName);
        reset(file1);
        while not system.Eof(file1) do
          readln(file1,v_str);
      end;
      closefile(file1);
    end;