AssignedAccessSettings.GetForUser(User) 方法

定义

检索指定用户分配的访问权限设置。

public:
 static AssignedAccessSettings ^ GetForUser(User ^ user);
 static AssignedAccessSettings GetForUser(User const& user);
public static AssignedAccessSettings GetForUser(User user);
function getForUser(user)
Public Shared Function GetForUser (user As User) As AssignedAccessSettings

参数

user
User

要获取其设置的用户。

返回

包含用户当前分配的访问设置的 settings 对象。

示例

using Windows.System.UserProfile; 

// Retrieve AssignedAccessSettings for all users
async void GetAssignedAccessSettingsForAllUsers()
{
    foreach (var user in await Windows.System.User.FindAllAsync())
    {
        var targetUserSettings = AssignedAccessSettings.GetForUser(user);
        // determine the behavior according to the user's AssignedAccessSettings
    }
}

适用于