在Window2003上执行System.Diagnostics.Process.GetProcessesByName等方法失败的原因

shine泪满天

shine泪满天

2016-01-29 13:00

在Window2003上执行System.Diagnostics.Process.GetProcessesByName等方法失败的原因,在Window2003上执行System.Diagnostics.Process.GetProcessesByName等方法失败的原因
在Windows2003上执行 System.Diagnostics.Process.GetProcessesByName等方法会报出Exception:
Couldn't get process information from remote machine.

这个错误的原因是: 获取Process与Performance Counter相关, 当前的执行用户不是Administrator 组成员
MSDN的解释:1.Performance information is not available to a non-admin account, which is not in the Performance Counter Users Group on Windows Server 2003. So the Process class could not get process performance information in this case.

2.Getting performance data from all the processes on the machine is pretty expensive. The operating system (OS) might load lots of DLLs and it might take seconds to complete. The floppy drive light will be on when the OS tries to find the index for some performance counter.
3.f the performance counter data was corrupted for any reason, the Process class could throw an exception while trying to convert some raw performance information into DateTime.

4.The Process class could not be used to get process information on machines without the process performance counter. Performance counters can be disabled in Windows. See the following link for details: http://www.microsoft.com/windows2000/techinfo/reskit/en-us/default.asp?url=/windows2000/techinfo/ reskit/en-us/regentry/94214.asp

The good news is that we have changed the implementation of the Process class in Visual Studio 2005 (our next release, code-named Whidbey). The Process class doesn't have a dependency on performance counter information any more (this is only true for local processes).

相关链接:
http://msdn.microsoft.com/netframework/programming/bcl/faq/SystemDiagnosticsProcessFAQ.aspx

展开更多 50%)
分享

猜你喜欢

在Window2003上执行System.Diagnostics.Process.GetProcessesByName等方法失败的原因

电脑网络
在Window2003上执行System.Diagnostics.Process.GetProcessesByName等方法失败的原因

System Idle Process是什么

电脑入门
System Idle Process是什么

s8lol主宰符文怎么配

英雄联盟 网络游戏
s8lol主宰符文怎么配

面试失败归纳 在失败中找原因

电脑网络
面试失败归纳 在失败中找原因

system idle process是什么进程可以关闭吗

电脑入门
system idle process是什么进程可以关闭吗

lol偷钱流符文搭配推荐

英雄联盟 网络游戏
lol偷钱流符文搭配推荐

system idle process占用率高怎么办

电脑
system idle process占用率高怎么办

Mysql入门系列:在MYSQL结果集上执行计算

编程语言 网络编程
Mysql入门系列:在MYSQL结果集上执行计算

lolAD刺客新符文搭配推荐

英雄联盟
lolAD刺客新符文搭配推荐

点击DataGrid的列标头在DataGrid最后一行显示该列的和

点击DataGrid的列标头在DataGrid最后一行显示该列的和

PHP强制对象类型之instanceof操作符(1)

PHP强制对象类型之instanceof操作符(1)
下拉加载更多内容 ↓