Possible Duplicate:
Get file name from URI string in C#
How to extract file name from an Uri in C#?
for instance, I have a Uri
"http://audacity.googlecode.com/files/audacity-win-2.0.exe"
but how to extract the file name
"audacity-win-2.0.exe"
and save it as a string?
Thank you,
Jerry
How about
Path.GetFileName(string path);
In your case
Path.GetFileName(new Uri("http://audacity.googlecode.com/files/audacity-win-2.0.exe").AbsolutePath);
Path.GetFileName
can do it...
Uri u = new Uri("http://audacity.googlecode.com/files/audacity-win-2.0.exe");
Path.GetFileName(u.AbsolutePath);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With