ServiceBase.Run 方法 (ServiceBase) [C#]请参见
ServiceBase 类 | ServiceBase 成员 | System.ServiceProcess 命名空间 | ServiceBase.Run 重载列表 | ServiceBase | OnStart
要求
平台: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
语言
C#C++JScriptVisual Basic全部显示
为包含单个服务的可执行文件提供主入口点。将服务加载到内存,以便可以启动该服务。[Visual Basic]
Overloads Public Shared Sub Run( _
ByVal service As ServiceBase _
)
[C#]
public static void Run(
ServiceBase service
);
[C++]
public: static void Run(
ServiceBase* service
);
[JScript]
public static function Run(
service : ServiceBase
);
参数
service
ServiceBase,指示要启动的服务。
异常
异常类型 条件
Win32Exception 您试图从命令行启动服务。 备注
在该服务可执行文件的 main() 函数中调用此重载以加载单个服务。当在服务上调用 Run 时,该服务被加载到内存中。在“服务控制管理器”向服务传递“开始”命令之前,该服务不启动。调用 ServiceBase.Run 的方式与 Windows 窗体应用程序的“运行”十分类似。如果 AutoLog 为 true,则在 service 参数指定的服务启动失败时将向事件日志中写入一项。要求
平台: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family请参见
ServiceBase 类 | ServiceBase 成员 | System.ServiceProcess 命名空间 | ServiceBase.Run 重载列表 | ServiceBase | OnStart
ServiceBase 类 | ServiceBase 成员 | System.ServiceProcess 命名空间 | ServiceBase.Run 重载列表 | ServiceBase | OnStart
要求
平台: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family
语言
C#C++JScriptVisual Basic全部显示
为包含单个服务的可执行文件提供主入口点。将服务加载到内存,以便可以启动该服务。[Visual Basic]
Overloads Public Shared Sub Run( _
ByVal service As ServiceBase _
)
[C#]
public static void Run(
ServiceBase service
);
[C++]
public: static void Run(
ServiceBase* service
);
[JScript]
public static function Run(
service : ServiceBase
);
参数
service
ServiceBase,指示要启动的服务。
异常
异常类型 条件
Win32Exception 您试图从命令行启动服务。 备注
在该服务可执行文件的 main() 函数中调用此重载以加载单个服务。当在服务上调用 Run 时,该服务被加载到内存中。在“服务控制管理器”向服务传递“开始”命令之前,该服务不启动。调用 ServiceBase.Run 的方式与 Windows 窗体应用程序的“运行”十分类似。如果 AutoLog 为 true,则在 service 参数指定的服务启动失败时将向事件日志中写入一项。要求
平台: Windows NT Server 4.0, Windows NT Workstation 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family请参见
ServiceBase 类 | ServiceBase 成员 | System.ServiceProcess 命名空间 | ServiceBase.Run 重载列表 | ServiceBase | OnStart
解决方案 »
- .net 一个大型字段放入数据库
- .net 页面问题
- 最后10分.求答为何我看微软webcast课程只有声音没图象???
- 如何用vs2005建立三层结构
- 可以通過javascript取得客戶端的IE設置信息嗎?
- 发送邮件时出错(请看代码)
- 高手请进.....一个类似于购物车的问题...谢谢....
- 没分了..兄弟没能不能帮一下忙啊.....能不能在没有装.netFramework的机子上运行我编译好的aspx
- 开发微信公众平台,不会连接已经写好的后台。在线满分求大神解答
- 如何将备注类型字段的内容格式化显示在网页中??超简单!
- 紧急求救!在asp.net/c#下调用标准DLL. 在本机器上可正常运行,其他机器上则出现容量错误.
- 请高手指点 如何 用ASP。NET + C# 连接SQL SERVER 数据库,在线等,解决后 即刻给分。
System.Diagnostics.ProcessStartInfo
startInfo = new System.Diagnostics.ProcessStartInfo();
System.Diagnostics.Process p;
startInfo.FileName = "C:\\winnt\\system32\\net.exe";
startInfo.Arguments = "send ntloginname The Message";
startInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden;
p = System.Diagnostics.Process.Start(startInfo);
p.WaitForExit();
Process proc = new Process();
proc.StartInfo.FileName = @"Notepad.exe";
proc.StartInfo.Arguments = "";
proc.Start();
using System.Diagnostics;
......
ProcessStartInfo psInfoCmd = new ProcessStartInfo();
psInfoCmd.FileName = "dnscmd.exe";
string strParameter = " "+ ServerName + " /recordadd " + Zone +" " + NodeName + " A " + IPData;
psInfoCmd.Arguments = strParameter; Process Proc = null;
try
{
Proc = Process.Start(psInfoCmd);
}
catch
{
//找不到文件
} //进程没有正常退出
Proc.WaitForExit(3000);
if (Proc.HasExited != true)
{
Proc.Kill();
}
比如:at 10:02 net send wuc abc