目录(地址)截取方法

来源:互联网 发布:阿里淘宝小二电话 编辑:程序博客网 时间:2024/06/05 11:30

"C:\\Users\\Administrator\\Desktop\\Jinglun255-12.zip"为字符串

方法string path = "C:\\Users\\Administrator\\Desktop\\Jinglun255-12.zip";
path = path.Substring(0, path.LastIndexOf('\\'));或者Path.GetDirectoryName

1 0
原创粉丝点击