Mar 26, 2012 at 5:21 PM


why in the downloaded program, I can not do not use "RasPreSharedKey"

Dim PhoneBook As New RasPhoneBook
Dim VpnEntry As RasEntry = RasEntry.CreateVpnEntry(VpnName, Destination, DotRas.RasVpnStrategy.L2tpOnly, _
DotRas.RasDevice.Create(VpnName, DotRas.RasDeviceType.Vpn))
VpnEntry.Options.UsePreSharedKey = True
VpnEntry.Options.UseLogOnCredentials = True
VpnEntry.UpdateCredentials(RasPreSharedKey.Client, PresharedKey)

RasPreSharedKey.Client - function does not exist in the dll library



VpnEntry.Options.UsePreSharedKey - function does not exist

Mar 27, 2012 at 2:45 AM

As stated in the SDK help documentation, RasPreSharedKey is only available on Windows XP and later, which means you need to use (at a minimum) the WINXP build.

Also, please make sure you check the documentation before asking the question, or search the discussions here before hand. This question has been asked repeatedly. Thank you for your cooperation.

Mar 27, 2012 at 5:08 PM

i have win7...

i can't build application, because

DotRas.RasEntry.UpdateCredentials(ByVal DotRas.RasPreSharedKey, ByVal String) As Boolean - function exists in the lib

but i can't use it

RasPreSharedKey is not declared, i can't create it... why?

Mar 27, 2012 at 5:51 PM

RasPreSharedKey is an enum, it's not something you "create". You just told me that the method exists, but you can't use it. This sounds like a problem between the chair and the keyboard, the SDK is fine.

I'm sorry, but you're on your own.

Mar 27, 2012 at 6:13 PM

Dim entry As RasEntry = RasEntry.CreateVpnEntry(EntryName, IPAddress.Loopback.ToString(), RasVpnStrategy.Default, RasDevice.GetDeviceByName("(PPTP)", RasDeviceType.Vpn))
entry.UpdateCredentials(New NetworkCredential("user", "pass")) - works perfectly [DotRas.RasEntry.UpdateCredentials(ByVal System.Net.NetworkCredential) As Boolean]




entry.UpdateCredentials(DotRas.RasPreSharedKey, "test") - do not work [DotRas.RasEntry.UpdateCredentials(ByVal DotRas.RasPreSharedKey, ByVal String) As Boolean] - i can't use this function, but it exists...  i do not understand, i'm so stupid :(


Mar 28, 2012 at 1:20 AM

Like I said, it's not something you create... you just need to access the member you want of the enum.

DotRas.RasPreSharedKey.Client would be what you're after.