function GetVolumeID: string; var vVolumeNameBuffer: ..] of Char; vVolumeSerialNumber: DWORD; vMaximumComponentLength: DWORD; vFileSystemFlags: DWORD; vFileSystemNameBuffer: ..] of Char; begin if GetVolumeInformation('C:\', vVolumeNameBuffer, SizeOf(
function TSetParkForm.RemoveSgin(str: string): string; // 去掉括号内的内容(包括括号) var i1, i2, i: integer; begin for i := 0 to length(str) - 1 do begin i1 := str.IndexOf('('); if i1 = -1 then break; i2 := str.IndexOf(')'); if i2 = -1 then break; end; result :=
------------------------------------------------------- ◇删掉程序自己的exe文件 procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction); var F:TextFile; begin AssignFile(F,'delself.bat'); Rewrite(F);{F为TextFile类型} WriteLn(F,'del '+ExtractFileName
program onlyRunOne; uses Forms,Windows,SysUtils, Dialogs, Unit1 in 'Unit1.pas' {Form1}; {$R *.res} var myMutex:HWND; begin myMutex:=CreateMutex(nil,false,'11111'); //名称只能全系统唯一. if WaitForSingleObject(myMutex,0)<>wait_TimeOut then begin Application.I