[英]C# project created install package on Win7 64 bit machine will not install on Win XP
[英]Not able to run netsh command in Win XP machine
我想使用以下代码以编程方式Reserve the port
和port binding
:
private void PortReserve()
{
try
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new
System.Diagnostics.ProcessStartInfo();
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
startInfo.FileName = "cmd.exe";
startInfo.UseShellExecute = true;
startInfo.Arguments = @"/c netsh http add urlacl url=https://127.0.0.1:8083/ user=EVERYONE";
process.StartInfo = startInfo;
process.Start();
}
catch (Exception ex)
{
throw ex;
}}
对于端口绑定:将startInfo.Arguments
的参数替换为@"/c netsh http add sslcert ipport=127.0.0.1:8083 certhash=df03c4b0b32f3302a3b70abe6b5dfd864d0986a5 appid={00112233-4455-6677-8899-CCBBCCDDEEFF} clientcertnegotiation=enable";
以上命令在win 7
, win servers
和8
台机器上完美win servers
但是当涉及到Win xp
它开始在CMD
抛出一个错误: The following command was not found http add urlacl url=https://127.0.0.1:8083 user=Everyone
我检查在所有machine
成功导入mmc
的证书。
在这种情况下我该怎么办?
根据MSDN,你不能使用netsh与xp。
如果您运行的是Windows Server 2003或Windows XP,请使用HttpCfg.exe工具。 使用Windows Server 2003安装此工具。 使用Windows XP,您可以在Windows XP Service Pack 2支持工具中下载该工具。 有关更多信息,请参阅Httpcfg概述。 Windows支持工具文档说明了Httpcfg.exe工具的语法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.