从Silverlight OOB应用程序如何检查进程是否正在运行
本文关键字:进程 是否 运行 检查 OOB Silverlight 应用程序 何检查 | 更新日期: 2023-09-27 18:12:48
如何查询进程是否在您的机器上运行从silverlight提升信任启用的浏览器外应用程序?
我想这会有帮助
private void button1_Click(object sender, RoutedEventArgs e)
{
using (dynamic SWbemLocator = AutomationFactory.CreateObject("WbemScripting.SWbemLocator"))
{
SWbemLocator.Security_.ImpersonationLevel = 3;
SWbemLocator.Security_.AuthenticationLevel = 4;
dynamic IService = SWbemLocator.ConnectServer(".", @"root'cimv2");
dynamic QueryResults = IService.ExecQuery(@"SELECT * FROM Win32_Process");
dynamic t = QueryResults.Count;
for (int i = 0; i < t; i++)
{
dynamic p = QueryResults.ItemIndex(i);
MessageBox.Show(p.name );
}
}
}