I am using vb.net with the DotRas SDK https://archive.codeplex.com/?p=dotras I have a problem, if I try to execute the example, I always get the error "The value 'gre' is not supported for conversion."
It must be an error with the call
RasDevice.GetDevice
The complete call is:
Dim entry As RasEntry = RasEntry.CreateVpnEntry(EntryName, IPAddress.Loopback.ToString(), RasVpnStrategy.Default, RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn))
Has anyone an idea, what the problem could be, or how it can be fixed?
I am using Windows Server 2016 64Bit
Thanks!
Edit:
Public Class MainForm
Public Const EntryName As String = "VPN Connection"
Private connectionHandle As RasHandle
Private Sub CreateEntryButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CreateEntryButton.Click
' This opens the phonebook so it can be used. Different overloads here will determine where the phonebook is opened/created.
Me.AllUsersPhoneBook.Open()
Dim device = RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn)
Dim entry = RasEntry.CreateVpnEntry(EntryName, IPAddress.Loopback.ToString(), RasVpnStrategy.Default, device)
' Add the new entry to the phone book.
Me.AllUsersPhoneBook.Entries.Add(entry)
End Sub