In .Net 4.5 you can use MimeMapping.GetMimeMapping:
string contentType = MimeMapping.GetMimeMapping("someFileName.pdf")
// contentType = "application/pdf"
More information
In .Net 4.5 you can use MimeMapping.GetMimeMapping:
string contentType = MimeMapping.GetMimeMapping("someFileName.pdf")
// contentType = "application/pdf"
More information