代码拉取完成,页面将自动刷新
program simwebserver;
uses
//CheckMem,
SvcMgr,
Forms,
Windows,
SysUtils,
WinSvc,
SimNTService,
{SimSplash, }
fmmain in 'fmmain.pas' {frmmain},
fmVirtualPath in 'fmVirtualPath.pas' {frmVPath},
fmExtend in 'fmExtend.pas' {frmExtend},
fmDefaultFile in 'fmDefaultFile.pas' {frmDftFile};
{$R *.res}
function Installing: Boolean;
begin
Result := FindCmdLineSwitch('INSTALL',['-','\','/'], True) or
FindCmdLineSwitch('UNINSTALL',['-','\','/'], True);
end;
function StartService: Boolean;
var
Mgr, Svc: Integer;
UserName, ServiceStartName: string;
Config: Pointer;
Size: DWord;
begin
Result := False;
Mgr := OpenSCManager(nil, nil, SC_MANAGER_ALL_ACCESS);
if Mgr <> 0 then
begin
Svc := OpenService(Mgr, PChar(SServiceName), SERVICE_ALL_ACCESS);
Result := Svc <> 0;
if Result then
begin
QueryServiceConfig(Svc, nil, 0, Size);
Config := AllocMem(Size);
try
QueryServiceConfig(Svc, Config, Size, Size);
ServiceStartName := PQueryServiceConfig(Config)^.lpServiceStartName;
if CompareText(ServiceStartName, 'LocalSystem') = 0 then
ServiceStartName := 'SYSTEM';
finally
Dispose(Config);
end;
CloseServiceHandle(Svc);
end;
CloseServiceHandle(Mgr);
end;
if Result then
begin
Size := 256;
SetLength(UserName, Size);
GetUserName(PChar(UserName), Size);
SetLength(UserName, StrLen(PChar(UserName)));
Result := CompareText(UserName, ServiceStartName) = 0;
end;
end;
begin
if not Installing then
begin
CreateMutex(nil, True, pchar(SimNTService.SServiceName));
if GetLastError = ERROR_ALREADY_EXISTS then
begin
MessageBox(0, PChar(SAlreadyRunning), PChar(SApplicationName), MB_ICONERROR);
Halt;
end;
end;
if Installing or StartService then
begin
SvcMgr.Application.Initialize;
SimService := TSimService.CreateNew(SvcMgr.Application, 0);
SvcMgr.Application.CreateForm(Tfrmmain, frmmain);
SvcMgr.Application.Run;
end else
begin
Application.Initialize;
//SimSplash.StartSplash;
Application.HelpFile := 'www.kapple.cn';
Application.Title := '٤web www.kapple.cn';
Application.CreateForm(Tfrmmain, frmmain);
//SimSplash.EndSplash;
Application.Run;
end;
end.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。