【发布时间】:2011-11-29 00:27:29
【问题描述】:
我想创建自签名证书并通过 c# 程序安装它。 我使用 makecert 来制作证书,我以 administrator 身份运行它并在 ProcessStartInfo.argument 中传递命令,但该命令不执行什么代码的问题?
这是我的代码:
public void Createasnewadmin()
{
ProcessStartInfo info = new ProcessStartInfo();
Process p = new Process();
info.FileName = Application.StartupPath+@"\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()
}
请告诉我问题出在哪里,不是以管理员身份执行?或者要执行的命令没有正确传递?
我认为它是以管理员身份执行的,因为我自己单击是按钮以管理员身份执行,这是由 windows 提示的
为什么命令没有执行?还有其他方法吗?
【问题讨论】:
标签: c# .net ssl user-permissions makecert