Process.StartTime Access Denied

前端 未结 5 1370
既然无缘
既然无缘 2020-12-21 04:30

My code needs to determine how long a particular process has been running. But it continues to fail with an access denied error message on the Process.StartTime

5条回答
  •  抹茶落季
    2020-12-21 04:50

    Process of .Net 1.1 uses the Performance Counters to get the information. Either they are disabled or the user does not have administrative rights. Making sure the Performance Counters are enabled and the user is an administrator should make your code work.

    Actually the "Performance Counter Users Group" should enough. The group doesn't exist by default. So you should create it yourself.

    Process of .Net 2.0 is not depended on the Performance Counters.

    See http://weblogs.asp.net/nunitaddin/archive/2004/11/21/267559.aspx

提交回复
热议问题