0

连接到使用 DotRas 创建的 IKEv2-VPN 时,我需要提交自定义远程 ID,但我还没有想出任何方法。

远程 id 已提交,但它只是提交的 IP。我需要自定义这个。

这是创建连接的代码:

    private void CreateConnection(String connectionName)
    {
        this.rasPhoneBook.Open(PHONEBOOK_PATH);
        RasEntry entry = RasEntry.CreateVpnEntry(connectionName, SERVER_ADDRESS,
            RasVpnStrategy.IkeV2Only,
            RasDevice.Create(connectionName, RasDeviceType.Vpn));
        this.rasPhoneBook.Entries.Add(entry);
    }

这就是我连接的地方:

    private void Connect()
    {
        // disconnect any lingering connections before connecting
        this.Disconnect();
        this.rasDialer.EntryName = this.serviceNameTextBox.Text;
        this.rasDialer.PhoneBookPath = PHONEBOOK_PATH;
        this.rasDialer.Credentials = new NetworkCredential(this.usernameTextBox.Text, 
            this.passwordTextBox.Text);
        this.rasDialer.DialAsync();
    }

感谢您提供解决此问题的任何帮助。

4

0 回答 0