方法一: string s = "D:\\123.txt"; FileInfo file = new FileInfo(s); string name = file.Name;方法二: string s = "D:\\123.txt"; string []ss = s.split(new char[]{'\\'}); string name = ss[ss.Length-1];