使用英语阅读

通过


ApiInformation.IsTypePresent(String) 方法

定义

返回 true 或 false 以指示是否存在指定类型。

public static bool IsTypePresent(string typeName);

参数

typeName
String

类型的命名空间限定名称。

返回

Boolean

如果存在指定的类型,则为 True;否则为 false

示例

if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.System.AppDiagnosticInfo"))
{
    Debug.WriteLine("Windows.System.AppDiagnosticInfo type was found");
}
else
{
    Debug.WriteLine("Windows.System.AppDiagnosticInfo type was NOT found");
}

适用于