protected virtual void OnCommandReceived(ExecuteCommandEventArgs e) { if (CommandReceived != null) { CommandReceived(this, e); } }
protected virtual void OnExecuteCommand(ExecuteCommandEventArgs e) { if (ExecuteCommand != null) { ExecuteCommand(this, e); } }
private void SocketListener_ExecuteCommand(object sender, ExecuteCommandEventArgs e) { LogHelper.Log("SocketListener_ExecuteCommand::" + e.Command); if (CommandReceived != null) { CommandReceived(this, e); } }
private void Server_CommandReceived(object sender, ExecuteCommandEventArgs e) { LogHelper.Log("Server_CommandReceived::" + e.Command); // windows service runs in isolation and cannot normally execute batch scripts or executables in the session of logged in user. // so the below ApplicationLoader class will identify the current user using winlogon and then execute programs in that session. LogHelper.Log("Starting process from windows service..."); ApplicationLoader.PROCESS_INFORMATION procInfo; ApplicationLoader.StartProcessAndBypassUAC(e.Command, out procInfo); }