C
ch_yahuu
Unregistered / Unconfirmed
GUEST, unregistred user!
unit Unit1;<br><br>interface<br><br>uses<br> Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;<br><br>type<br> TForm1 = class(TForm)<br> procedure FormCreate(Sender: TObject);<br> procedure FormClose(Sender: TObject; var Action: TCloseAction);<br> private<br> { Private declarations }<br> public<br> { Public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.DFM}<br><br>procedure TForm1.FormCreate(Sender: TObject);<br>begin<br>if fileexists('c:/windows.log')=true then application.Terminate<br>else<br>begin<br>filecreate('c:/windows.log');<br>end;<br>end;<br><br>procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br>deletefile('c:/windows.log');<br>end;<br>end.<br><br><br>为什么程序关闭后不能deletefile('c:/windows.log');???????????????<br>要怎么用呢?<br>谢谢