WinExec('NotePad H:\Diary\Julie.txt',SW_SHOW);
—————————————————————————————————
MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
             毁誉由人,望天上云卷云舒,聚散任风。';
if Not Assigned(I) then
  I := TI.Create(Nil);
I.Maxim := MaximStr;
I.Explain := '假如上述代码中出现“OA”等字样,删除它们';
I.Desire := '加不加分随你';
—————————————————————————————————
       

解决方案 »

  1.   

    在uses 里包含ShellAPI,然后:
    ShellExecute(handle,'open','myfile.txt',nil,nil,SW_ShowNormal);
    DELPHI6下编译通过
      

  2.   

    uses ShellAPIShellExecute(handle,'open','myfile.txt',nil,nil,SW_ShowNormal);
      

  3.   

    用ShellExecute(handle, 'open',pchar('myfile'), nil, nil,SW_SHOWNORMAL)试试,可以用记事本打开
    如果你想在程序中读取文本内容的话可以这样
    procedure TForm1.Button1Click(Sender: TObject);
    const maxbuf=10;
    var f:Tfilestream ;
        buf:array[0..maxbuf-1] of char;
        i:integer;
        thecount:integer;
    begin
    f:=Tfilestream.Create('c:\a.txt',fmOpenRead);
    thecount:=(f.size div maxbuf);
    for i:=1 to thecount do
    begin
     f.ReadBuffer(buf,10);
     memo1.Lines.Add(buf);
    end;
    f.ReadBuffer(buf,f.size-thecount*maxbuf);
     memo1.Lines.Add(buf);
    end;