UWP VPN配置文件未创建VPN连接

我创建了一个VPN配置文件,但未设置以下设置:名称,密码和身份验证方法。我试图以管理员身份运行项目,但它也没有起作用。有什么问题吗?

  auto mgr = ref new VpnmanagementAgent();

  auto  profile                          =   ref new VpnNativeProfile();
  profile->AlwaysOn                      =   true;
  profile->NativeProtocolType            =   VpnNativeProtocolType::L2tp;
  profile->Userauthenticationmethod      =   VpnAuthenticationmethod::PresharedKey;
  profile->ProfileName                   =   "TestVpn";
  profile->RememberCredentials           =   true;
  profile->RequireVpnClientAppUI         =   true;
  profile->RoutingPolicyType             =   VpnRoutingPolicyType::ForceAllTrafficOverVpn;
  profile->Servers->Append("101.99.74.214");  

  auto profileStatus    = mgr->UpdateProfileFromObjectAsync(profile);

  auto credentials      = ref new PasswordCredential();
  credentials->username = "vpn";
  credentials->Password = "vpn";  

  auto connectStatus  = mgr->ConnectProfileWithPasswordCredentialAsync(profile,credentials);

UWP VPN配置文件未创建VPN连接

liqilong2259 回答:UWP VPN配置文件未创建VPN连接

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3082563.html

大家都在问