文章出處

    /// <summary>
        /// 物理路徑轉網絡路徑
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public string urlconvertor(string path)
        {
            string tmpRootDir = HttpContext.Current.Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString());//獲取程序根目錄
            string temp = "\\" + path.Replace(tmpRootDir, ""); //轉換成相對路徑
            temp = temp.Replace(@"\", @"/");
            return temp;
        }

 


文章列表


不含病毒。www.avast.com
arrow
arrow
    全站熱搜

    大師兄 發表在 痞客邦 留言(0) 人氣()