c# - How to get the type of data from a URL -
c# - How to get the type of data from a URL - after implementing basic version of simple downloader, have spent few hours googling know how type of url .mp3,.mp4 etc.for sites such daily motion etc who's url don't have appended @ end.this because downloader works these types link without specific types makes download kb's file having nil play. here code determine content-type decide *.extension downloading: webclient mywebclient = new webclient(); string datastring = mywebclient.downloadstring("http://www.dailymotion.com/video/x1viyeu_pakistani-actress-meera-reema-saima-dance-on-faisal-ahmed-music-album-launch_news"); namevaluecollection headers = mywebclient.responseheaders; foreach (string key in headers.allkeys) { console.writeline("header:{0},value:{1}", key, headers[key]); } it returned me list of outputs on console among line was: header:content-type,value:text/html;chars...