【发布时间】:2015-02-12 22:09:32
【问题描述】:
我正在使用 ContentType 类来解析网页的内容类型 (type + encoding)。
我注意到此输入失败 (FormatException):
文本/html;字符集:windows-1255
这是代码:
using System.Net.Mime;
//...
ContentType ct;
try
{
ct = new ContentType(content_type);
}
catch (FormatException ex)
{
return eFileType.Unknown;
}
为什么会抛出FormatException?
【问题讨论】:
标签: c# mime-types content-type system.net formatexception