gpt4 book ai didi

uwp - 有没有办法在 UWP 应用程序中从 IVpnProfile 获取 ConnectionStatus?

转载 作者:行者123 更新时间:2023-12-03 15:17:00 26 4
gpt4 key购买 nike

我有以下 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());
}

我想检查 ConnectionStatus 但这在 IVpnProfile 界面上不可用。
我尝试添加以下内容无济于事,因为 ConnectionStatus 在具体的 VpnPlugInProfile 和 VpnNativeProfile 类中可用:
VpnPlugInProfile pp = vp.as<VpnPlugInProfile>();
if (pp != nullptr)
wprintf(L"ConnectionStatus = %d\n", pp.ConnectionStatus());

这只会给出一个无效的句柄错误。

有没有办法从 IVpnProfile 获取 ConnectionStatus?

最佳答案

提示:无效句柄错误是 Windows 中的一个错误;它已被修复,并且修复程序在下层进行了维护(可能到 RS5 和 19H1)

关于uwp - 有没有办法在 UWP 应用程序中从 IVpnProfile 获取 ConnectionStatus?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52854770/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com