- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何在 Delphi 2007 中检测 Windows 服务状态并更改其状态。
最佳答案
WinSvc 拥有您需要的所有 Windows API 方法。您可以创建以下单元以获得简单的类接口(interface):
unit ServiceManager;
interface
uses
SysUtils, Windows, Winsvc;
type
TServiceManager = class;
{ The states a service can be in. }
TServiceState = (ssStopped,
ssStartPending,
ssStopPending,
ssRunning,
ssContinuePending,
ssPausePending,
ssPaused);
{ Enumeration of the standard "controls" a service can accept. The shutdown control, if not
accepted is ignored. The shutdown control can only be sent when a shutdown occurs. }
TServiceAccept = (saStop,
saPauseContinue,
saShutdown);
{ The set of "controls" a service can accept. }
TServiceAccepts = set of TServiceAccept;
{ The service startup enumeration determines how a service is started. ssAutomatic will start the
service automatically at startup. ssManual will allow applications and other services to start
this service manually and ssDisabled will disallow the service to be started altogether (but it
will be kept in the service database). }
TServiceStartup = (ssAutomatic,
ssManual,
ssDisabled);
{ Gives information of and controls a single Service. Can be accessed via @link(TServiceManager). }
TServiceInfo = class
private
{ Placeholder of the Index property. Assigned by the ServiceManager that created this instance. }
FIndex: Integer;
{ Link the the creating service manager. }
FServiceManager: TServiceManager;
{ Handle of the service during several member calls. }
FHandle: SC_HANDLE;
{ Status of thi service. This contains several fields for several properties. }
FServiceStatus: TServiceStatus;
{ Key name of this service. }
FServiceName: string;
{ Display name oif this service. }
FDisplayName: string;
{ Are de depenedents searched. If so the @link(FDependents) array is filled with those. }
FDependentsSearched: Boolean;
{ Array of @link(TServiceInfo) instances that depent on this service. Only filled when
@link(FDependentsSearched) is True. }
FDependents: array of TServiceInfo;
{ Placeholder for the live}
FLive: Boolean;
// Query Config
FConfigQueried: Boolean;
FOwnProcess: Boolean;
FInteractive: Boolean;
FStartType: TServiceStartup;
FBinaryPath: string;
FUserName: string;
function GetDependent(Index: Integer): TServiceInfo;
function GetDepenentCount: Integer;
function GetState: TServiceState;
function GetOwnProcess: Boolean;
function GetInteractive: Boolean;
function GetStartType: TServiceStartup;
function GetBinaryPath: string;
procedure SetState(const Value: TServiceState);
function GetServiceAccept: TServiceAccepts;
procedure SetStartType(const Value: TServiceStartup);
protected
{ Cleanup the handle created with @link(GetHandle). }
procedure CleanupHandle;
{ Open a handle to the service with the given access rights.
This handle can be deleted via @link(CleanupHandle). }
procedure GetHandle(Access: DWORD);
{ Query all dependent services (list them via the @link(TServiceManager). }
procedure SearchDependants;
{ Query the current status of this service }
procedure Query;
{ Wait for a given status of this service... }
procedure WaitFor(State: DWORD);
{ Fetch the configuration information }
procedure QueryConfig;
public
constructor Create;
destructor Destroy; override;
{ Action: Pause a running service. }
procedure ServicePause(Wait: Boolean);
{ Action: Continue a paused service. }
procedure ServiceContinue(Wait: Boolean);
{ Action: Stop a running service. }
procedure ServiceStop(Wait: Boolean);
{ Action: Start a not running service.
You can use the @link(State) property to change the state from ssStopped to ssRunning }
procedure ServiceStart(Wait: Boolean);
{ Name of this service. }
property ServiceName: string read FServiceName;
{ Display name of this service }
property DisplayName: string read FDisplayName;
{ Number of dependant services of this service }
property DependentCount: Integer read GetDepenentCount;
{ Access to serviced that depent on this service }
property Dependents[Index: Integer]: TServiceInfo read GetDependent;
{ The current state of the service. You can set the service only to the non-transitional states.
You can restart the service by first setting the State to first ssStopped and second ssRunning. }
property State: TServiceState read GetState write SetState;
{ Are various properties using live information or historic information. }
property Live: Boolean read FLive write FLive;
{ When service is running, does it run as a separate process (own process) or combined with
other services under svchost. }
property OwnProcess: Boolean read GetOwnProcess;
{ Is the service capable of interacting with the desktop.
Possible: The logon must the Local System Account. }
property Interactive: Boolean read GetInteractive;
{ How is this service started. See @link(TServiceStartup) for a description of startup types.
If you want to set this property, the manager must be activeted with AllowLocking set to True. }
property StartType: TServiceStartup read GetStartType write SetStartType;
{ Path to the binary that implements the service. }
property BinaryPath: string read GetBinaryPath;
{ See what controls the service accepts. }
property Accepts: TServiceAccepts read GetServiceAccept;
{ Index in ServiceManagers list }
property Index: Integer read FIndex;
end;
{ A service manager allows the services of a particular machine to be explored and modified. }
TServiceManager = class
private
FManager: SC_HANDLE;
FLock: SC_LOCK;
FMachineName: string;
FServices: array of TServiceInfo;
FAllowLocking: Boolean;
function GetActive: Boolean;
procedure SetActive(const Value: Boolean);
procedure SetMachineName(const Value: string);
function GetServiceCount: Integer;
function GetService(Index: Integer): TServiceInfo;
function GetServiceByName(Name: string): TServiceInfo;
procedure SetAllowLocking(const Value: Boolean);
protected
{ Internal function that frees up all the @link(TServiceInfo) classes. }
procedure CleanupServices;
{ Internal function for locking the manager }
procedure Lock;
{ Internal function for unlocking the manager }
procedure Unlock;
public
constructor Create;
destructor Destroy; override;
{ Requeries the states, names etc of all services on the given @link(MachineName).
Works only while active. }
procedure RebuildServicesList;
{ Delete a service... }
procedure DeleteService(Index: Integer);
{ Get the number of services. This number is refreshed when the @link(Active) is
set to True or @link(RebuildServicesList) is called. Works only while active. }
property ServiceCount: Integer read GetServiceCount;
{ Find a servce by index in the services list. This list is refreshed when the @link(Active) is
set to True or @link(RebuildServicesList) is called. Works only while active. Valid Index
values are 0..@link(ServiceCount) - 1. }
property Services[Index: Integer]: TServiceInfo read GetService;
{ Find services by name (case insensitive). Works only while active. If no service can be found
an exception will be raised. }
property ServiceByName[Name: string]: TServiceInfo read GetServiceByName;
// published
{ Activate / deactivate the service managaer. In active state can you access the individual
service }
property Active: Boolean read GetActive write SetActive;
{ The machine name for which you want the services list. }
property MachineName: string read FMachineName write SetMachineName;
{ Allow locking... Is needed only when changing several properties in TServiceInfo.
Property can only be set while inactive. }
property AllowLocking: Boolean read FAllowLocking write SetAllowLocking;
end;
implementation
{ TServiceManager }
procedure TServiceManager.RebuildServicesList;
var
Services, S: PEnumServiceStatus;
BytesNeeded,ServicesReturned,ResumeHandle: DWORD;
i: Integer;
begin
if not Active then raise Exception.Create('BuildServicesList only works when active');
// Cleanup
CleanupServices;
// Get the amount of memory we need...
ServicesReturned := 0;
ResumeHandle := 0;
Services := nil;
if EnumServicesStatus(FManager, SERVICE_WIN32, SERVICE_ACTIVE or SERVICE_INACTIVE,
Services^,0, BytesNeeded,ServicesReturned,ResumeHandle) then Exit;
if GetLastError <> ERROR_MORE_DATA then RaiseLastOSError;
// And... Get all the data...
GetMem(Services,BytesNeeded);
try
ServicesReturned := 0;
ResumeHandle := 0;
S := Services;
if not EnumServicesStatus(FManager, SERVICE_WIN32, SERVICE_ACTIVE or SERVICE_INACTIVE,
Services^,BytesNeeded, BytesNeeded,ServicesReturned,ResumeHandle) then Exit;
SetLength(FServices,ServicesReturned);
for i := 0 to ServicesReturned - 1 do begin
FServices[i] := TServiceInfo.Create;
FServices[i].FServiceName := S^.lpServiceName;
FServices[i].FDisplayName := S^.lpDisplayName;
FServices[i].FServiceStatus := S^.ServiceStatus;
FServices[i].FServiceManager := Self;
FServices[i].FIndex := i;
Inc(S);
end;
finally
FreeMem(Services);
end;
end;
procedure TServiceManager.CleanupServices;
var
i: Integer;
begin
for i := 0 to High(FServices) do FServices[i].Free;
SetLength(FServices,0);
end;
constructor TServiceManager.Create;
begin
inherited Create;
FManager := 0;
end;
destructor TServiceManager.Destroy;
begin
Active := False;
inherited Destroy;
end;
function TServiceManager.GetActive: Boolean;
begin
Result := FManager <> 0;
end;
function TServiceManager.GetService(Index: Integer): TServiceInfo;
begin
// Sanity check
if (Index < 0) or (Index >= Length(FServices)) then raise Exception.Create('Index out of bounds');
// Fetch the object of interest
Result := FServices[Index];
end;
function TServiceManager.GetServiceByName(Name: string): TServiceInfo;
var
i: Integer;
begin
Name := Uppercase(Name);
for i := 0 to High(FServices) do begin
Result := FServices[i];
if Uppercase(Result.ServiceName) = Name then Exit;
end;
raise Exception.Create('Service not found');
end;
function TServiceManager.GetServiceCount: Integer;
begin
Result := Length(FServices);
end;
procedure TServiceManager.SetActive(const Value: Boolean);
var
VersionInfo: TOSVersionInfo;
DesiredAccess: DWORD;
begin
if Value then begin
if FManager <> 0 then Exit;
// Check that we are NT, 2000, XP or above...
VersionInfo.dwOSVersionInfoSize := sizeof(VersionInfo);
if not Windows.GetVersionEx(VersionInfo) then RaiseLastOSError;
if VersionInfo.dwPlatformId <> VER_PLATFORM_WIN32_NT then begin
raise Exception.Create('This program only works on Windows NT, 2000 or XP');
end;
// Open service manager
DesiredAccess := SC_MANAGER_CONNECT or SC_MANAGER_ENUMERATE_SERVICE;
if FAllowLocking then Inc(DesiredAccess,SC_MANAGER_LOCK);
FManager := OpenSCManager(PChar(FMachineName),nil,DesiredAccess);
if FManager = 0 then RaiseLastOSError;
// Fetch the srvices list
RebuildServicesList;
end else begin
if FManager = 0 then Exit;
// CleanupServices
CleanupServices;
// Close service manager
if Assigned(FLock) then Unlock;
CloseServiceHandle(FManager);
FManager := 0;
end;
end;
procedure TServiceManager.SetMachineName(const Value: string);
begin
if Active then raise Exception.Create('Cannot change machine name while active');
FMachineName := Value;
end;
procedure TServiceManager.DeleteService(Index: Integer);
begin
// todo: implementation
raise Exception.Create('Not implemented');
end;
procedure TServiceManager.Lock;
begin
if not FAllowLocking then raise Exception.Create('Locking of the service manager not allowed!');
FLock := LockServiceDatabase(FManager);
if FLock = nil then RaiseLastOSError;
end;
procedure TServiceManager.Unlock;
begin
// We are unlocked already
if FLock = nil then Exit;
// Unlock...
if not UnlockServiceDatabase(FLock) then RaiseLastOSError;
FLock := nil;
end;
procedure TServiceManager.SetAllowLocking(const Value: Boolean);
begin
if Active then raise Exception.Create('Cannot change allow locking while active');
FAllowLocking := Value;
end;
{ TServiceInfo }
procedure TServiceInfo.CleanupHandle;
begin
if FHandle = 0 then Exit;
CloseServiceHandle(FHandle);
FHandle := 0;
end;
constructor TServiceInfo.Create;
begin
FDependentsSearched := False;
FConfigQueried := False;
FHandle := 0;
FLive := False;
end;
destructor TServiceInfo.Destroy;
begin
CleanupHandle;
inherited Destroy;
end;
function TServiceInfo.GetDependent(Index: Integer): TServiceInfo;
begin
SearchDependants;
if (Index < 0) or (Index >= Length(FDependents)) then raise Exception.Create('Index out of bounds');
Result := FDependents[Index];
end;
function TServiceInfo.GetDepenentCount: Integer;
begin
SearchDependants;
Result := Length(FDependents);
end;
procedure TServiceInfo.GetHandle(Access: DWORD);
begin
if FHandle <> 0 then Exit;
FHandle := OpenService(FServiceManager.FManager,PChar(FServiceName),Access);
if FHandle = 0 then RaiseLastOSError;
end;
function TServiceInfo.GetState: TServiceState;
begin
if FLive then Query;
case FServiceStatus.dwCurrentState of
SERVICE_STOPPED: Result := ssStopped;
SERVICE_START_PENDING: Result := ssStartPending;
SERVICE_STOP_PENDING: Result := ssStopPending;
SERVICE_RUNNING: Result := ssRunning;
SERVICE_CONTINUE_PENDING: Result := ssContinuePending;
SERVICE_PAUSE_PENDING: Result := ssPausePending;
SERVICE_PAUSED: Result := ssPaused;
else raise Exception.Create('Service State unknown');
end;
end;
procedure TServiceInfo.Query;
var
Status: TServiceStatus;
begin
if FHandle <> 0 then begin
if not QueryServiceStatus(FHandle,Status) then RaiseLastOSError;
end else begin
GetHandle(SERVICE_QUERY_STATUS);
try
if not QueryServiceStatus(FHandle,Status) then RaiseLastOSError;
finally
CleanupHandle;
end;
end;
FServiceStatus := Status;
end;
procedure TServiceInfo.ServiceContinue(Wait: Boolean);
var
Status: TServiceStatus;
begin
GetHandle(SERVICE_QUERY_STATUS or SERVICE_PAUSE_CONTINUE);
try
if not (saPauseContinue in Accepts) then raise Exception.Create('Service cannot be continued');
if not ControlService(FHandle,SERVICE_CONTROL_CONTINUE,Status) then RaiseLastOSError;
if Wait then WaitFor(SERVICE_RUNNING);
finally
CleanupHandle;
end;
end;
procedure TServiceInfo.ServicePause(Wait: Boolean);
var
Status: TServiceStatus;
begin
GetHandle(SERVICE_QUERY_STATUS or SERVICE_PAUSE_CONTINUE);
try
if not (saPauseContinue in Accepts) then raise Exception.Create('Service cannot be paused');
if not ControlService(FHandle,SERVICE_CONTROL_PAUSE,Status) then RaiseLastOSError;
if Wait then WaitFor(SERVICE_PAUSED);
finally
CleanupHandle;
end;
end;
procedure TServiceInfo.ServiceStart(Wait: Boolean);
var
P: PCHar;
begin
GetHandle(SERVICE_QUERY_STATUS or SERVICE_START);
try
P := nil;
if not StartService(FHandle,0,P) then RaiseLastOSError;
if Wait then WaitFor(SERVICE_RUNNING);
finally
CleanupHandle;
end;
end;
procedure TServiceInfo.ServiceStop(Wait: Boolean);
var
Status: TServiceStatus;
begin
GetHandle(SERVICE_QUERY_STATUS or SERVICE_STOP);
try
if not (saStop in Accepts) then raise Exception.Create('Service cannot be Stopped');
if not ControlService(FHandle,SERVICE_CONTROL_STOP,Status) then RaiseLastOSError;
if Wait then WaitFor(SERVICE_STOPPED);
finally
CleanupHandle;
end;
end;
procedure TServiceInfo.WaitFor(State: DWORD);
var
OldCheckPoint, Wait: DWORD;
begin
Query;
while State <> FServiceStatus.dwCurrentState do begin
OldCheckPoint := FServiceStatus.dwCheckPoint;
Wait := FServiceStatus.dwWaitHint;
if Wait <= 0 then Wait := 5000;
Sleep(Wait);
Query;
if State = FServiceStatus.dwCurrentState then Break;
if FServiceStatus.dwCheckPoint <> OldCheckPoint then begin
raise Exception.Create('Service did not react within timeframe given');
end;
end;
end;
procedure TServiceInfo.SearchDependants;
var
Services, S: PEnumServiceStatus;
BytesNeeded, ServicesReturned: DWORD;
i: Integer;
begin
if FDependentsSearched then Exit;
// No dependants found...
SetLength(FDependents,0);
// We need a handle to the service to do any good...
GetHandle(SERVICE_ENUMERATE_DEPENDENTS);
try
// See how many dependantw we have...
Services := nil;
BytesNeeded := 0;
ServicesReturned := 0;
if EnumDependentServices(FHandle,SERVICE_ACTIVE + SERVICE_INACTIVE, Services^,
0, BytesNeeded, ServicesReturned) then Exit;
if GetLastError <> ERROR_MORE_DATA then RaiseLastOSError;
// Allocate the buffer needed and fetch all info...
GetMem(Services,BytesNeeded);
try
if not EnumDependentServices(FHandle,SERVICE_ACTIVE + SERVICE_INACTIVE, Services^,
BytesNeeded, BytesNeeded, ServicesReturned) then RaiseLastOSError;
// Now process it...
S := Services;
SetLength(FDependents,ServicesReturned);
for i := 0 to High(FDependents) do begin
FDependents[i] := FServiceManager.ServiceByName[S^.lpServiceName];
Inc(S);
end;
finally
FreeMem(Services);
end;
finally
CleanupHandle;
end;
FDependentsSearched := True;
end;
procedure TServiceInfo.QueryConfig;
var
Buffer: PQueryServiceConfig;
BytesNeeded: DWORD;
begin
GetHandle(SERVICE_QUERY_CONFIG);
try
// See how large our buffer must be...
Buffer := nil;
assert(QueryServiceConfig(FHandle,Buffer,0,BytesNeeded) = False);
if GetLastError <> ERROR_INSUFFICIENT_BUFFER then RaiseLastOSError;
GetMem(Buffer,BytesNeeded);
try
// Perform the query...
if not QueryServiceConfig(FHandle,Buffer,BytesNeeded,BytesNeeded) then RaiseLastOSError;
// Analyse the query...
assert(Buffer^.dwServiceType and SERVICE_WIN32 <> 0); // It must be a WIN32 service
FOwnProcess := (Buffer^.dwServiceType and SERVICE_WIN32) = SERVICE_WIN32_OWN_PROCESS;
FInteractive := (Buffer^.dwServiceType and SERVICE_INTERACTIVE_PROCESS) = SERVICE_INTERACTIVE_PROCESS;
case Buffer^.dwStartType of
SERVICE_AUTO_START: FStartType := ssAutomatic;
SERVICE_DEMAND_START: FStartType := ssManual;
SERVICE_DISABLED: FStartType := ssDisabled;
else raise Exception.Create('Service Start Type unknown');
end;
FBinaryPath := Buffer^.lpBinaryPathName;
FUsername := Buffer^.lpServiceStartName;
FConfigQueried := True;
finally
FreeMem(Buffer);
end;
finally
CleanupHandle;
end;
end;
function TServiceInfo.GetOwnProcess: Boolean;
begin
if FLive or not FConfigQueried then QueryConfig;
Result := FOwnProcess;
end;
function TServiceInfo.GetInteractive: Boolean;
begin
if FLive or not FConfigQueried then QueryConfig;
Result := FInteractive;
end;
function TServiceInfo.GetStartType: TServiceStartup;
begin
if FLive or not FConfigQueried then QueryConfig;
Result := FStartType;
end;
function TServiceInfo.GetBinaryPath: string;
begin
if FLive or not FConfigQueried then QueryConfig;
Result := FBinaryPath;
end;
function TServiceInfo.GetServiceAccept: TServiceAccepts;
begin
Result := [];
if FLive then Query;
if FServiceStatus.dwControlsAccepted and SERVICE_ACCEPT_PAUSE_CONTINUE <> 0 then Result := Result + [saPauseContinue];
if FServiceStatus.dwControlsAccepted and SERVICE_ACCEPT_STOP <> 0 then Result := Result + [saStop];
if FServiceStatus.dwControlsAccepted and SERVICE_ACCEPT_SHUTDOWN <> 0 then Result := Result + [saShutdown];
end;
procedure TServiceInfo.SetState(const Value: TServiceState);
var
OldState: TServiceState;
begin
// Make sure we have the latest current state and that it is not a transitional state.
if not FLive then Query;
OldState := GetState;
case OldState of
ssStartPending: WaitFor(SERVICE_RUNNING);
ssStopPending: WaitFor(SERVICE_STOPPED);
ssContinuePending: WaitFor(SERVICE_RUNNING);
ssPausePending: WaitFor(SERVICE_PAUSED);
end;
OldState := GetState;
// See what we need to do...
case Value of
ssStopped: if OldState <> ssStopped then ServiceStop(True);
ssRunning: case OldState of
ssStopped: ServiceStart(True);
ssPaused: ServiceContinue(True);
end;
ssPaused: case OldState of
ssStopped: begin
ServiceStart(True);
try
ServicePause(True); // some services do not support pause/continue!
except
ServiceStop(True);
raise;
end;
end;
ssRunning: ServicePause(True);
end;
else raise Exception.Create('Cannot set a transitional state in TServiceInfo.');
end;
end;
procedure TServiceInfo.SetStartType(const Value: TServiceStartup);
const
NewStartTypes: array [TServiceStartup] of DWORD =
(SERVICE_AUTO_START, SERVICE_DEMAND_START, SERVICE_DISABLED);
begin
// Check if it is not a change?
QueryConfig;
if Value = FStartType then Exit;
// Alter it...
FServiceManager.Lock;
try
GetHandle(SERVICE_CHANGE_CONFIG);
try
// We locked the manager and are allowed to change the configuration...
if not ChangeServiceConfig(FHandle,SERVICE_NO_CHANGE,NewStartTypes[Value],SERVICE_NO_CHANGE,
nil,nil,nil,nil,nil,nil,nil) then RaiseLastOSError;
// well... we changed it, mark as such
FStartType := Value;
finally
CleanupHandle;
end;
finally
FServiceManager.Unlock;
end;
end;
end.
关于delphi - 检测Windows服务状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5913279/
为什么我可以在控制台 window.window.window.window 中执行此操作并无限追加 .window 并返回 DOM 窗口? 最佳答案 因为 window 对象有一个指向它自身的 wi
Windows管理员用户和系统用户之间有什么权限区别吗? 有些时候,我必须将 cmd 窗口提升到系统权限才能删除一些文件。这可能是因为系统用户锁定了文件,或者系统用户可能具有更高的访问权限,我希望找出
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
Windows 服务和 Windows 进程之间的区别是什么? 最佳答案 服务是真正的 Windows 进程,没有区别。服务的唯一特殊之处在于它由操作系统启动并在单独的 session 中运行。一个独
我有一个 Windows 网络 (peer-2-peer) 以及 Active Directory,我需要记录向服务器发送任何类型打印的用户的名称。我想编写一个程序来记录他们的用户名和/或他们各自的
当我让一个 Windows 服务尝试安装另一个 Windows 服务时遇到问题。 具体来说,我有一个 TeamCity 代理在 Windows 2008 AWS 实例上为我运行测试。这些测试是用 Ja
我创建了一个应用程序来接收广播的 Windows 消息,效果很好。当我把它变成一个服务、安装它并启动服务时,该服务没有收到消息。 最佳答案 服务可能必须被授予访问桌面的权限。从服务属性、“登录”选项卡
我正在使用 Delphi 2010 编写应用程序。我希望在 Windows 启动时启动我的应用程序。我需要它在最新版本的 Windows XP、7.0 和最新的服务器中工作。 将其存储在以下关键工作下
我想开发一个适用于所有三个版本的 Windows XP、Vista 和 7 的应用程序。该应用程序允许人们选择要打开的文件,并允许他们在某些操作后保存文件。三个版本的 Windows 中的每一个都有不
对于\Windows\中的文件类型与\Windows\System32 中的文件类型是否有标准约定? 我正在开发一个 SDK,其中包含各种 DLL、帮助程序 exe 和 Windows 服务 exe。
要求是,必须在 WINDOWS7 机器上配置自动登录,但是这个自动登录应该等待(即延迟)直到另一个 Windows 服务发出继续自动登录的信号。 我使用了自定义凭据提供程序,它在其中等待另一个 Win
很抱歉,这不是一个大问题,而是更多的帮助人们解决这些特定问题的方法。我正在解决的问题要求使用串行I/O,但主要在Windows CE 6.0下运行。但是,最近有人问我是否也可以在Windows下运行该
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
不幸的是 SC 命令在 W2000 上还不可用,所以我不能使用它。 我正在尝试检查服务是否在 W2000 服务器上运行,如果它没有运行,脚本应该能够启动该服务。 如何在 Windows 2000 上执
如何在登录到 Windows 之前启动 Windows 窗体应用程序?是否可以在登录到 Windows 之前启动 Windows 窗体应用程序?如果不是,我是否有机会在登录前启动 Windows 服务
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 这个问题似乎不是关于 a specific programming problem, a softwar
我想在 XML 文件中区分 Windows XP 和 Windows 7。我想我会在 XML 中为它使用一个环境变量。 但是我找不到在 Windows 中定义的任何系统环境变量来提供此信息。 我看到了
有谁知道我可以在注册表中的哪个位置检查机器上是否安装了这些应用程序: Windows 通讯录 Windows 联系人 最佳答案 来自 Microsoft:我知道它说的是 win 95,但 reg 是一
我正在尝试从我的 Windows 服务器调用放置在远程 Windows 服务器上的批处理文件。我在远程服务器上安装了 freeSSHd。我尝试使用 putty/plink 但没有结果。 我使用的命令语
( 大家好。我是 Windows 编程的新手,所以如果已经有人问过我,我提前道歉,我只是不知道要搜索什么,但这个问题一直让我发疯,我知道有人可能真的很容易回答这个问题。) 我的公司有一个在 Windo
我是一名优秀的程序员,十分优秀!