public static string GetStringMimeType(MimeType mime)
{
string strMime = "";
switch (mime)
{
case MimeType.text_html: strMime = "text/html; charset=utf-8"; break;
case MimeType.text_javascript: strMime = "text/javascript"; break;
case MimeType.multipart_xmixedreplace:
strMime = "multipart/x-mixed-replace; boundary=rnA00A"; break;
case MimeType.application_xml_charsetutf8:
strMime = "application/xml; charset=utf-8";
break;
default:
strMime = mime.ToString().Replace("_", "/");
break;
}
return strMime;
}
public static MimeType GetContentTypeByExtension(string extension)
{
switch (extension)
{
case "css":
return MimeType.text_css;
case "gif":
return MimeType.image_gif;
case "jpg":
case "jpeg":
return MimeType.image_jpeg;