共用方式為


IFileToContentTypeService.GetContentTypeForFilePathOnly(String) Method

Definition

Get the default IContentType for a file located at filePath.

public:
 Microsoft::VisualStudio::Utilities::IContentType ^ GetContentTypeForFilePathOnly(System::String ^ filePath);
public Microsoft.VisualStudio.Utilities.IContentType GetContentTypeForFilePathOnly (string filePath);
abstract member GetContentTypeForFilePathOnly : string -> Microsoft.VisualStudio.Utilities.IContentType
Public Function GetContentTypeForFilePathOnly (filePath As String) As IContentType

Parameters

filePath
String

Name of the file in question.

Returns

Excpected content type or UnknownContentType if no content type is found.

Remarks

If no IContentType is found using declared IFilePathToContentTypeProvider assets, then UnknownContentType is returned.

Applies to