string str = "Test1234";
string ss = str.Substring( ex.Length-4,4);

解决方案 »

  1.   

    呵呵 错了不好意思,应该是
    string str = "Test1234";
    string ss = str.Substring( str.Length-4,4);
      

  2.   

    怎么这样的错误信息:
    StartIndex cannot be less than zero. Parameter name: startIndex 
      

  3.   

    //取得上传文件名称
    fileName = System.IO.Path.GetFileName(postedFile.FileName);
    //取得上传文件后缀名称;
    fileExtension = System.IO.Path.GetExtension(fileName);
      

  4.   

    CS0103: The name 'fileName' does not exist in the class or namespace 'ASP.WebForm2_aspx'
    还是不对呀?
      

  5.   

    CS0246: The type or namespace name 'postedFile' could not be found (are you missing a using directive or an assembly reference?)
      

  6.   

    string SouFileName = "sldjf.sld.jpg"
    //取得上传文件名称
    string fileName = System.IO.Path.GetFileName(SouFileName );
    //取得上传文件后缀名称;
    string fileExtension = System.IO.Path.GetExtension(fileName);