Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating RAS dialup in VB .NET? 1

Status
Not open for further replies.

ikidd

Programmer
Jul 11, 2002
23
0
0
CA
I'm trying to create a VPN (PPTP) connection entirely in code, use it, and destroy it. So far, the only thing I've been able to find is references to RASENTRY, RasSetEntryProperties, etc for use in C++. Is this implemented in VB .NET and if so, are there any suggestions about how to go about it? I've spent quite a while looking and it's not very obvious what the methodology would be.

Thanks
Ian Kidd
 
Hi ikidd

Did you ever get this working? I'm looking to do something very similair and haven't found much good information.. Can you post how you make a VPN connection using VB.NET?

Thanks...



 
I looked briefly at Stravis' link, and made a quick program with the C++ addin. It looks like it would work, but whomever wrote it wasn't too good at English and some of the functions are mispelled, so you have to get used to that.

I tried the Rasdemo project in the link and it gives me a system exception that I track down to a message in the locals windows as 'arg = "Message "There was a hardware failure in the modem (or other connecting device)."' when I try a VPN (not dialup phone#) that is more than the 64 chars allowed for the argument in the C# function call (onNotify1). I know nothing about C#, I can sort of blindly follow it so I can't really debug it. I tried a VB project and added the RAS module as a reference but couldn't decipher the usage. It's about as well documented as my own code, which is to say not at all. I didn't spend too much time on it but I imagine you could troubleshoot it out if you knew some C#.


I ended up just using Rasdial commandline and creating Phonebook entries each time, it was faster for my app.

If you do get it working, I'd love to hear how because I have a few uses for it. I find it hard to imagine there isn't a VB function that does the same, where you can create and tear down phonebook entries on the fly. The functions I found in MSDN only seem to apply to c# and had no equivalents in VB.NET. Perhaps it's too low-level. Or perhaps I am :)
 
I ran across this http://groups.google.com/groups?selm=An87uzi%23BHA.1532%40cpmsftngxa08]News Group Post[/url] and that someone may find it useful and fitting to this thread.


Two strings walk into a bar. The first string says to the bartender: 'Bartender, I'll have a beer. u.5n$x5t?*&4ru!2[sACC~ErJ'. The second string says: 'Pardon my friend, he isn't NULL terminated'.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top