function TService1.fn_GetServiceFilenName:String;
var strBuf: array[1..512] of Char;
sFileName:String;
begin
ZeroMemory(@strBuf, 512);
GetModuleFileName(GetModuleHandle(nil), @strBuf, 512);
sFileName := Trim(strBuf);
Result := sFileName
Result := ExtractFileDir(sFileName); //回傳路徑
end;
沒有留言:
張貼留言