如题

解决方案 »

  1.   

    String s = "C://aa//b.text";
    s.Replace("//","/");
    s.Replace("C:","http://10.11.22.33");
    是这意思么?
      

  2.   


    string text = "C://aa//b.text"; 
    string s=System.Text.RegularExpressions.Regex.Replace(text,@"(C://aa//)(\w+).text","http://10.11.22.33/a/$2.text",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
    Response.Write(s);
      

  3.   

    前面盘符路径不固定的话就这样:string text = "C://aa//b.text"; 
    string s=System.Text.RegularExpressions.Regex.Replace(text,@"([A-Za-z]://)([^/]\w+//)+(\w+).text","http://10.11.22.33/a/$3.text",System.Text.RegularExpressions.RegexOptions.IgnoreCase);
    Response.Write(s);