Win32Exception (0x80004005): 拒绝访问
下面是堆栈:[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 }
求帮忙。。。到底是什么权限限制了?百度谷歌基本上翻遍了,还没解决!!!这问题弄了两天了!!!到底该怎么解决。。。
如果问题解决了,可以追加分数。。。 --------------------编程问答-------------------- http://www.cnblogs.com/xqghp/archive/2011/10/26/2224693.html
试试这个网址下的问题6解决方法
补充:.NET技术 , ASP.NET