http://www.abc.com/images/01.jpg
c# 如何取到01.jpg
不能用替换字符和正则的方法.谢谢!

解决方案 »

  1.   

    更正为如何取到"images/01.jpg "字符
      

  2.   

    string str = "sub/image/1.jpeg";
    int i = str.LastIndexOf("/");
    str = str.Substring(i + 1);str为结果
      

  3.   


    1.Request.CurrentExecutionFilePath 
    2.Request.FilePath 
    3.Request.Path 
    4.Request.RawUrl
    5.Request.Url.AbsolutePath
    6.Request.Url.LocalPath这6种都可以搞定 LZ任选其一吧  随便在程序写哪一行都可以运行
      

  4.   


    string str = str.Substring(Request.RawUrl.LastIndexOf(@"/")+1); 
      

  5.   


    string s = "http://www.abc.com/images/01.jpg";
    s = s.ToLower().Substring(s.IndexOf("/", 8) + 1);