1

次のコードを使用して、プログラムで実行したいと思い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とmachineで完全に機能していますが7、次の場合にwin serversエラーが発生し始めました。 8Win xpCMDThe following command was not found http add urlacl url=https://127.0.0.1:8083 user=Everyone

mmcすべてで正常にインポートされた証明書を確認しますmachine

そのような場合はどうすればよいですか?

4

1 に答える 1

4

MSDNによると、xpではnetshを使用できません。

Windows Server2003またはWindowsXPを実行している場合は、HttpCfg.exeツールを使用してください。Windows Server 2003では、このツールがインストールされています。Windows XPでは、Windows XP ServicePack2サポートツールからツールをダウンロードできます。詳細については、Httpcfgの概要を参照してください。Windowsサポートツールのドキュメントでは、Httpcfg.exeツールの構文について説明しています。

于 2013-03-26T07:00:50.407 に答える