i want get extension file of url .
for example get extension http://www.iranfairco.com/download-file/02912bb889cb24. if extension this file is gif.
EDIT:
for example this url "http://www.online-convert.com/result/d8b423c3cbc05000cc52ce7015873e72"
Please help me how can get extension of this url?
Why does Path.GetExtension not work for you?
EDIT
Ah, so your url doesn't specify the extension you are after. That means anything could be behind it.
Just by inspecting the string value of the url, you can't see what will behind it. Your (second) example point (ultimately) to a .gif file, but it could also have been a .jpg, .doc (or even .exe).
You will need to do a webrequest to see what you get back. Usually you could try a HEAD to get just the headers (and inspect the content type), but I don't think that will work here. Try Fiddler to see what you get back, then you can refine your question.
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