日期:2014-05-17 浏览次数:21202 次
base.OnAfterInstall(e.SavedState);
ManagementObject wmiService = null;
ManagementBaseObject InParam = null;
try
{
wmiService = new ManagementObject(string.Format("Win32_Service.Name='{0}'", Constants.ServiceName));
InParam = wmiService.GetMethodParameters("Change");
InParam["DesktopInteract"] = true;
wmiService.InvokeMethod("Change", InParam, null);
}
finally
{
if (InParam != null)
InParam.Dispose();
if (wmiService != null)
wmiService.Dispose();
}