如何截取文字 E:\temp\FCKeditor_2.6.1.zip一个文件路径我想得到FCKeditor_2.6.1.zip有什么方便的方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 System.IO.FileInfo f = new System.IO.FileInfo(@"E:\temp\FCKeditor_2.6.1.zip");f.Name file.FileName.Substring(file.FileName.LastIndexOf("\\"))我是这样的方法不知会不会太笨 Path.GetFileName(@"E:\temp\FCKeditor_2.6.1.zip"); string str = "E:\\temp\\FCKeditor_2.6.1.zip "; int kk = str.LastIndexOf('\\'); string finStr = str.Substring(kk + 1); Response.Write(finStr); string strPath = @"E:\temp\FCKeditor_2.6.1.zip";strPath.Substring(strPath.LastIndexOf(@"\")+1,strPath.Length-(strPath.LastIndexOf(@"\")+1));我很笨的... string strPath = @"E:\temp\FCKeditor_2.6.1.zip";strPath.Substring(strPath.LastIndexOf(@"\")+1); 笨办法:string a = "E:\temp\FCKeditor_2.6.1.zip";string[] b = a.Split('\')string c = b[2];c就是你要取的值 string strPath = "E:\temp\FCKeditor_2.6.1.zip";strPath.Substring(strPath.LastIndexOf("\\")+1,strPath.Length-(strPath.LastIndexOf(@"\")+1));就这么截取~~ @"问题 如何使用asp.net来查看ftp密码 asp.net动态生成静态页面怎么做呀 在线急等一条sql语句或者存储过程 DataGrid更新问题 (100分沥血跪求!!)如何在DataGrid控件中显示超链接 各位大哥,帮我看看这是什么错误? 关于jmail收取附件的问题(请思归等各位高手帮帮我) 报错:操作必须使用一个可更新的查询 asp.net连接数据库 初学者请教 有关于调用函数的问题呀!
f.Name
我是这样的方法
不知会不会太笨
int kk = str.LastIndexOf('\\');
string finStr = str.Substring(kk + 1);
Response.Write(finStr);
string strPath = @"E:\temp\FCKeditor_2.6.1.zip";
strPath.Substring(strPath.LastIndexOf(@"\")+1,strPath.Length-(strPath.LastIndexOf(@"\")+1));我很笨的...
strPath.Substring(strPath.LastIndexOf(@"\")+1);
string a = "E:\temp\FCKeditor_2.6.1.zip";string[] b = a.Split('\')string c = b[2];c就是你要取的值
strPath.Substring(strPath.LastIndexOf("\\")+1,strPath.Length-(strPath.LastIndexOf(@"\")+1));就这么截取~~