我正在尝试在 DotRas 中指定 sstp 连接 - 我找到了一个示例如何做到这一点 -
RasDevice device = RasDevice.GetDeviceByName("(SSTP)", RasDeviceType.Vpn, false);
if (device == null) throw new Exception("Cannot get RasDevice");
RasEntry entry = RasEntry.CreateVpnEntry(connectionName, serverAddress, RasVpnStrategy.SstpOnly, device);
但在我RasVpnStrategy
那里只有Default
, L2tpFirst
, L2tpOnly
, PptpFirst
,可用的PptpOnly
字段。
我发现:
/// <summary>
/// Defines the VPN strategies.
/// </summary>
public enum RasVpnStrategy
{
/// <summary>
/// Dials PPTP first. If PPTP fails, L2TP is attempted.
/// </summary>
Default = 0,
/// <summary>
/// Dial PPTP only.
/// </summary>
PptpOnly = 1,
/// <summary>
/// Always dial PPTP first.
/// </summary>
PptpFirst = 2,
/// <summary>
/// Dial L2TP only.
/// </summary>
L2tpOnly = 3,
/// <summary>
/// Always dial L2TP first.
/// </summary>
L2tpFirst = 4,
#if (WIN2K8)
/// <summary>
/// Dial SSTP only.
/// </summary>
SstpOnly = 5,
/// <summary>
/// Always dial SSTP first.
/// </summary>
SstpFirst = 6
#endif
}
所以,我什至不能在我的应用程序中指定 Sstp?(Win7)