我想创建自签名证书并使用通过c#程序进行安装。 我用makecert使证书我运行它管理员我在ProcessStartInfo.argument传递命令,但该命令不执行什么是在代码中的问题?如何在使用管理权限执行的进程中运行命令?
这里是我的代码:
public void Createasnewadmin()
{
ProcessStartInfo info = new ProcessStartInfo();
Process p = new Process();
info.FileName = [email protected]"\makecert.exe";
info.UseShellExecute = true;
info.Verb = "runas"; // Provides Run as Administrator
info.Arguments = "makecert testCert_admin_check.cer";
//i just create sample certificate but it doesn't get created
//The problem is above line the command doesn't get execute
p.StartInfo=info;
p.Start()
}
其中的问题是,它不以管理员身份运行,请告诉我?或者要执行的命令没有正确传递?
,我认为它是作为管理员执行,因为我自己点击Yes按钮执行为由
为什么不命令执行窗口
提示管理员?有没有其他方法?
一些什么类似http://stackoverflow.com/questions/7610727/to-run-cmd-as-administrator-along-with - 命令 – purvang