没有杀死进程的权限
问题代码如下[DllImport("User32.dll", CharSet = CharSet.Auto)]
public static extern int GetWindowThreadProcessId(IntPtr hwnd, out int ID);
public static void Kill(Excel.Application excel)
{
if (excel == null) return;
IntPtr t = new IntPtr(excel.Hwnd); //得到这个句柄,具体作用是得到这块内存入口
int k = 0;
GetWindowThreadProcessId(t, out k); //得到本进程唯一标志k
System.Diagnostics.Process p = System.Diagnostics.Process.GetProcessById(k); //得到对进程k的引用
p.Kill(); //关闭进程k
}
本机运行没有问题。。发布的IIS上。就出现
[Win32Exception (0x80004005): 拒绝访问。]
System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited) +9020424
System.Diagnostics.Process.Kill() +49
YingXia.a.Kill(Application excel) +84
YingXia.a.BasicHandel(FileUpload upload) +11703
System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
我按照网上的一些帖子。。设置了IIS上应用程序池里面的标识。。将其设置了管理员帐号和密码上去。。
但还是不行。。
本机环境如下:
windows server 2012
IIS 8.0
安装了域 --------------------编程问答-------------------- 客户端权限不够?
访问的时候让客户端来执行??? --------------------编程问答-------------------- 你这样的话,权限太大了 --------------------编程问答--------------------
我是直接以服务器管理员帐号作为客户端来打开网页的哦。。 --------------------编程问答--------------------
。。。。。。。。。 --------------------编程问答--------------------
补充:.NET技术 , ASP.NET