共用方式為


FileExtensionContentTypeProvider.TryGetContentType(String, String) 方法

定義

已知檔案路徑,然後判斷 MIME 類型

public:
 virtual bool TryGetContentType(System::String ^ subpath, [Runtime::InteropServices::Out] System::String ^ % contentType);
public bool TryGetContentType (string subpath, out string contentType);
abstract member TryGetContentType : string * string -> bool
override this.TryGetContentType : string * string -> bool
Public Function TryGetContentType (subpath As String, ByRef contentType As String) As Boolean

參數

subpath
String

檔案路徑

contentType
String

結果的 MIME 類型

傳回

如果可以判斷 MIME 類型,則為 true

實作

適用於