.Net檢測是否虛擬目錄 并返回 "/"

 private string GetAppPath()
        {
            string applicationPath = HttpContext.Current.Request.ApplicationPath;
            if (applicationPath.Length > 1)
            {
                applicationPath = applicationPath + "/";
            }
           
            return applicationPath;
        }

你可能感兴趣的:(.net)