日期:2014-05-17 浏览次数:20434 次
string htmlFile = "E:\\xyz\\toy\\aa.html"; FileInfo fi = new FileInfo(htmlFile); string fileName=fi.Name;//aa.html string directName = fi.DirectoryName;//E:\\xyz\\toy
------解决方案--------------------
int i=(aa.html).Length //aa.html 长度 string htmlFile = "E:\\xyz\\toy\\aa.html"; string a = htmlFile.Substring(htmlFile.Length-i,i); string a = htmlFile.Substring(0,htmlFile.Length-i);