我一直试图弄清楚如何使用Inno安装脚本安装和注册IIS,但到目前为止我还没有成功.
我需要创建一个应用程序,带有.Net版本4的应用程序池和一个虚拟目录,获取机器的IP并继续使用此IP编辑网站的绑定.
到目前为止,我的安装中的所有工作都是检查IIS是否已安装.
如果有人曾经做过这样的事情,我真的很感激你能否分享你的剧本.
谢谢.
我只是有一个简单的问题,看看自己上课时最好的做法是什么.
假设这个类有一个私有成员在构造函数中初始化,我是否必须检查这个私有成员在另一个公共的非静态方法中是否为null?或者是假设该变量不为null,因此不必添加该检查?
例如,如下所示,检查null是绝对必要的.
// Provides Client connections.
public TcpClient tcpSocket;
/// <summary>
/// Creates a telnet connection to the host and port provided.
/// </summary>
/// <param name="Hostname">The host to connect to. Generally, Localhost to connect to the Network API on the server itself.</param>
/// <param name="Port">Generally 23, for Telnet Connections.</param>
public TelnetConnection(string Hostname, int Port)
{
tcpSocket = new TcpClient(Hostname, Port);
}
/// <summary>
/// Closes the socket and disposes of the TcpClient.
/// </summary>
public void CloseSocket()
{ …Run Code Online (Sandbox Code Playgroud) 所以我需要从字符串中删除转义的反斜杠(在我的例子中,路径就像"C:\ Program Files(x86)\ Microsoft Office\Office14\WINWORD.EXE \").
要替换我已尝试过以下内容:
String openWith = "C:\\Program Files (x86)\\Microsoft Office\\Office14\\WINWORD.EXE";
string newString = openWith.Replace(@"\\", @"\");
openWith = openWith.Replace(@"\\", @"\");
openWith = Regex.Replace(openWith,"\\\\","\\");
Run Code Online (Sandbox Code Playgroud)
但这些都不起作用!! 有人能够向我解释为什么会这样吗?
先感谢您!
c# ×2
.net ×1
asp.net ×1
backslash ×1
filepath ×1
iis ×1
inno-setup ×1
installation ×1
regex ×1
replace ×1