HttpListenerResponse.ContentType 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置返回内容的 MIME 类型。
public:
property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };
public string? ContentType { get; set; }
public string ContentType { get; set; }
member this.ContentType : string with get, set
Public Property ContentType As String
属性值
String 实例,包含响应的 Content-Type
标头文本。
例外
为集运算指定的值为 null
。
为设置操作指定的值为空字符串 ("")。
此对象已关闭。
注解
与 Web 浏览器通信时,在返回除 text/html
之外的任何内容类型时,应显式设置此属性。
有关响应标头的完整列表,请参阅 HttpResponseHeader 枚举。