如何从C#获取网站的物理路径(例如" MyWebSite")?我的服务器是IIS 7。
使用c#中的msdeploy,我有以下代码:
var deployBaseOptions = new DeploymentBaseOptions
{
ComputerName = connectOption.UrlPublishing,
UserName = connectOption.UserName,
Password = connectOption.Password,
AuthenticationType = "Basic",
};
答案 0 :(得分:0)
即var path = Server.MapPath("~");
答案 1 :(得分:0)