[英]How to get physical path of a website/app
How do I get the physical path of a website (for example "MyWebSite") from C#? 如何从C#获取网站的物理路径(例如“ MyWebSite”)? My server is IIS 7.
我的服务器是IIS 7。
Using msdeploy from c#, I have the following code: 从C#使用msdeploy,我有以下代码:
var deployBaseOptions = new DeploymentBaseOptions
{
ComputerName = connectOption.UrlPublishing,
UserName = connectOption.UserName,
Password = connectOption.Password,
AuthenticationType = "Basic",
};
Use Server.MapPath 使用Server.MapPath
ie var path = Server.MapPath("~");
即
var path = Server.MapPath("~");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.