PackagePart.ContentType 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得內容數據流的MIME類型。
public:
property System::String ^ ContentType { System::String ^ get(); };
public string ContentType { get; }
member this.ContentType : string
Public ReadOnly Property ContentType As String
屬性值
元件之內容數據流的MIME類型。
例外狀況
組件已經刪除。
-或-
Package 沒有開啟 (已經呼叫 Dispose(Boolean) 或 Close())。
-或-
衍生類別 GetContentTypeCore() 方法傳回的字串是空的。
備註
ContentType 是唯讀屬性,只能在父 Package 系開啟時存取。
建 ContentType 構函式會自動設定 PackagePart 屬性。 建構函式設定之後, ContentType 就無法變更 。
屬性 ContentType 是MIME類型,根據 RFC 2616超文本傳輸通訊協定 - HTTP,第3.7節。 下表顯示 XML 檔規格 (XPS) 檔中所使用的內容 MIME 類型範例。
描述 | 內容類型 |
---|---|
字型 | application/vnd.ms-opentype |
ICC 設定檔 | application/vnd.ms-color.iccprofile |
JPEG 影像 | image/jpeg |
模糊字型 | application/vnd.ms-package.obfuscated-opentype |
PNG 影像 | image/png |
PrintTicket | application/vnd.ms-printing.printticket+xml |
TIFF 影像 | image/tiff |
Windows Media 相片影像 | image/vnd.ms-photo |
適用於
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應