下面是堆栈:
[Win32Exception (0x80004005): 拒绝访问。]
System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) +1985316
System.Diagnostics.Process.Kill() +49
ApricotCMS.Controllers.ImportController.Kill(_Application excel) +144
ApricotCMS.Controllers.ImportController.Family(HttpPostedFileBase file) +27340
lambda_method(Closure , ControllerBase , Object[] ) +127
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +264
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +39
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +129
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +826266
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +314
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +825488
System.Web.Mvc.Controller.ExecuteCore() +159
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375下面是代码(IIS7.5+windows server 2008 r2):
1 System.Diagnostics.Process[] procList = System.Diagnostics.Process.GetProcesses();
2 IntPtr t = new IntPtr(excel.Hwnd); //得到这个句柄,具体作用是得到这块内存入口
3
4 int k = 0;
5 GetWindowThreadProcessId(t, out k); //得到本进程唯一标志k
6 foreach (System.Diagnostics.Process proc in procList)
7 {
8 if (k == proc.Id)
9 {
10 proc.Kill();
11 }
12 }
求帮忙。。。到底是什么权限限制了?百度谷歌基本上翻遍了,还没解决!!!这问题弄了两天了!!!到底该怎么解决。。。
如果问题解决了可以追加分数
7 回答
胡说叔叔
TA贡献1804条经验 获得超8个赞
看日志是从 HttpApplication.ExecuteStep IIS中调用的,IIS的运行账号一般是Network service,因此不具有杀进程的权限, 你可以使用管理员运行IIS,看看,然后特别处理
- 7 回答
- 0 关注
- 1400 浏览
添加回答
举报
0/150
提交
取消