Pau*_*hin 11 vpn uwp c++-winrt
我有以下WinRT代码,可以很好地发现活动的VPN配置文件:
VpnManagementAgent vpn;
auto profiles = vpn.GetProfilesAsync().get();
wprintf(L"Found %d profiles\n", profiles.Size());
for (auto vp : profiles)
{
wprintf(L"Found profile %s\n", vp.ProfileName().c_str());
}
Run Code Online (Sandbox Code Playgroud)
我想检查ConnectionStatus,但这在IVpnProfile接口上不可用。我尝试添加以下内容无济于事,因为具体的VpnPlugInProfile和VpnNativeProfile类中的ConnectionStatus可用:
VpnPlugInProfile pp = vp.as<VpnPlugInProfile>();
if (pp != nullptr)
wprintf(L"ConnectionStatus = %d\n", pp.ConnectionStatus());
Run Code Online (Sandbox Code Playgroud)
这只是给出一个无效的句柄错误。
有没有办法从IVpnProfile获取ConnectionStatus?
| 归档时间: |
|
| 查看次数: |
259 次 |
| 最近记录: |