c#操作IIS 添加SSL出现的问题
2010-01-26 11:00
375 查看
我用同一个IP绑定不同站点,都添加了SSL,证书是同一个,
在服务器上用shell命令执行下面命令:
cscript.exe c:InetpubAdminScriptsadsutil.vbs set /w3svc/******/SecureBindings ":443:mysite.com"
可以添加IIS;
但我用c#写的程序在本地执行时,报错:
CScript 错误: 加载脚本“c:InetpubAdminScriptsadsutil.vbs”失败(拒绝访问。 )。
不知道是不是权限的问题,于是我在服务器上把adsutil.vbs的权限设置为erveryone后,又报了
没有权限
ErrNumber: 70 (0x46)
Error Trying To SET the Property: SecureBindings
这样的错;谁能帮我解决这个问题
执行Shell命令的代码如下:
string command= @"cscript.exe c:InetpubAdminScriptsadsutil.vbs set /w3svc/" + siteID + "/SecureBindings ":443:" + hostHeader + """;
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c " + command;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(command);
p.StandardInput.WriteLine("exit");
log.Info("6:" + p.StandardOutput.ReadToEnd());
p.WaitForExit();
p.Close();
你的IIS里面是否已经有了这个网站了,你先在IIS里添加这个网站,然后将SSL端口配成444,再添加看看,如果没有加过这个站点,应该不可以使用这条命令
IIS的https一个端口只能有一个网站
在服务器上用shell命令执行下面命令:
cscript.exe c:InetpubAdminScriptsadsutil.vbs set /w3svc/******/SecureBindings ":443:mysite.com"
可以添加IIS;
但我用c#写的程序在本地执行时,报错:
CScript 错误: 加载脚本“c:InetpubAdminScriptsadsutil.vbs”失败(拒绝访问。 )。
不知道是不是权限的问题,于是我在服务器上把adsutil.vbs的权限设置为erveryone后,又报了
没有权限
ErrNumber: 70 (0x46)
Error Trying To SET the Property: SecureBindings
这样的错;谁能帮我解决这个问题
执行Shell命令的代码如下:
string command= @"cscript.exe c:InetpubAdminScriptsadsutil.vbs set /w3svc/" + siteID + "/SecureBindings ":443:" + hostHeader + """;
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.Arguments = "/c " + command;
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
p.Start();
p.StandardInput.WriteLine(command);
p.StandardInput.WriteLine("exit");
log.Info("6:" + p.StandardOutput.ReadToEnd());
p.WaitForExit();
p.Close();
你的IIS里面是否已经有了这个网站了,你先在IIS里添加这个网站,然后将SSL端口配成444,再添加看看,如果没有加过这个站点,应该不可以使用这条命令
IIS的https一个端口只能有一个网站
相关文章推荐
- asp.net操作word 配置在IIS上出现的问题
- 使用C#访问VBA,发布到IIS后出现以下错误,按此博文已解决问题
- C#操作IIS添加MIME类型(win2003)
- c# 操作dbf文件时,出现“command contains unrecognized phrase keyword” 的问题
- 关于在server2012添加IIS功能中出现WinRM无法启动的问题解决过程
- C#操作IIS创建应用程序池出现异常:无效索引(Exception from HRESULT:0x80070585)
- 关于C#操作IIS问题
- ASP.NET 在IIS 操作Excel时出现的权限问题的解决方案
- windows2008下配置iis时出现错误“由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。”
- C#项目发布到IIS后CSS及Jquery出现问题的几种情况
- c#对oracle操作时候 出现的乱码问题。
- zTree插件和layer弹出层结合进行添加,删除,修改操作时,针对出现调用父父页面方法出现问题,解决方法
- 解决Vue2.0中使用less给元素添加背景图片出现的问题
- IIS配置中出现的问题
- Android在listview添加checkbox实现单选多选操作问题
- virtualbox win7 iis 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序
- IIS出现Logon 或failureServer Application Error 等问题的解决办法
- IIS处理并发请求时出现的问题及解决
- 解决IIS部署asp/asp.net网站无法浏览并出现w3wp.exe调试问题
- 解决大量TCPIP连接后出现“因为系统缺乏足够缓冲区空间或者因为队列已满无法执行套接字上操作”的问题