AppUriHandlerRegistrationManager.GetDefault 方法

定义

为当前用户的调用应用创建 AppUriHandlerRegistrationManager

public:
 static AppUriHandlerRegistrationManager ^ GetDefault();
 static AppUriHandlerRegistrationManager GetDefault();
public static AppUriHandlerRegistrationManager GetDefault();
function getDefault()
Public Shared Function GetDefault () As AppUriHandlerRegistrationManager

返回

可用于访问 AppUriHandlerRegistrationManager的 AppUriHandlerRegistrationManager

示例

string uriHandlerName = "Runtime"; 
Windows.System.AppUriHandlerRegistrationManager manager = AppUriHandlerRegistrationManager.GetDefault(); // Or GetForUser() for multi user-aware apps. 
AppUriHandlerRegistration registration = manager.TryGetRegistration(uriHandlerName);
if (registration != null)
{
    // App can get or set hosts as needed
}

注解

支持多个用户的应用应改用 AppUriHandlerRegistrationManager.GetForUser

适用于

另请参阅