I'm writing a program that performs certain actions based on the content of an URL. What's the best way to determine content type?
//pseudo code
WebClient c = new WebClient();
var data = c.DownloadData("http://mysite.com/download/2938923");
//var dataType = get data type
switch(dataType)
{
case "pdf":
//Run PDF
break;
case "doc":
//Run Word
break;
}