【发布时间】:2011-06-10 20:29:54
【问题描述】:
我正在开发一个在服务器上安装软件的网络应用程序。
如果我登录特定组中的用户,然后以管理员身份运行 install msi,我可以手动运行安装。
此特定组是本地管理员组的一部分。
我的应用程序池作为 Network_Service 运行。
我模仿然后使用 runAs 动词吗?但是我需要知道作为用户的 u/p 和管理员的 u/p .. 我认为
我正在使用 System.Diagnostics.Process 类。
System.Diagnostics.ProcessStartInfo oInfo = new System.Diagnostics.ProcessStartInfo(str);
oInfo.UseShellExecute = false;
oInfo.ErrorDialog = false;
oInfo.CreateNoWindow = false;
oInfo.RedirectStandardOutput = true;
Process p = System.Diagnostics.Process.Start(oInfo);
System.IO.StreamReader oReader2 = p.StandardOutput;
string sRes = oReader2.ReadToEnd();
oReader2.Close();
return sRes;
【问题讨论】: