I'm looking for a way in C# to search a string for the file and it's extension. So for example if I have a string "//houtestserver/common/file开发者_如何学运维1.pdf" how can I set another string to file1.pdf?
Thanks everyone in advance
System.IO.Path.GetFileName("//houtestserver/common/file1.pdf");
will return "file1.pdf". Is that enough for your needs?
string filename = Path.GetFileName(path);
精彩评论