zoukankan      html  css  js  c++  java
  • 相对路径,绝对路径互转

        代码
    //原创aloxy 

    //2007.12.19 

    //本地路径转换成URL相对路径
         private string urlconvertor(string imagesurl1)
        {
            
    string tmpRootDir = Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString());//获取程序根目录
            string imagesurl2 = imagesurl1.Replace(tmpRootDir, ""); //转换成相对路径
             imagesurl2 = imagesurl2.Replace(@"\"@"/");
            
    //imagesurl2 = imagesurl2.Replace(@"Aspx_Uc/", @"");
            return imagesurl2;
         }
        
    //相对路径转换成服务器本地物理路径
        private string urlconvertorlocal(string imagesurl1)
        {
            
    string tmpRootDir = Server.MapPath(System.Web.HttpContext.Current.Request.ApplicationPath.ToString());//获取程序根目录
            string imagesurl2 = tmpRootDir + imagesurl1.Replace(@"/"@"\"); //转换成绝对路径
             return imagesurl2;
         }

    走向地狱的途中,不小心走了程序员这条路,路上一个个黑心的老板,和暗无天日的加班,我才发现,通往地狱的路径中,我们这行是最短的。

  • 相关阅读:
    在SharePoint 2010中创建网站的权限级别
    SharePoint 2013 Pop-Up Dialogs
    SharePoint 2010 Pop-Up Dialogs
    sharepoint 2010 页面添加footer方法 custom footer for sharepoint 2010 master page
    Using SharePoint 2010 dialogs
    Spring Security
    mysql优化
    memcached缓存技术
    网页静态化技术
    最小生成树
  • 原文地址:https://www.cnblogs.com/zlfucku/p/1692012.html
Copyright © 2011-2022 走看看