Miscellaneous Debris

Avner Kashtan's Frustrations and Exultations

Wrapping the RAS

A couple of years ago I had a need to automate dialing a RAS connection and retrieving the IP address allocated by the server. I found myself writing a small, rather limited wrapper around the RAS P/Invoke calls. Far from complete, it only covered the functionality I needed for that project. But it was useful, and I kept it around.

Over the years I've had several people contact me to get a copy of that wrapper to save them time and effort, so to simplify matters, I'll simply attach my RasWrap project here and let google lead people to my blog, rather than to an ancient post on Channel9 where I last mentioned it.

The attachment contains two projects - the RasWrap project itself containing the P/Invoke signatures and wrapper classes to facilitate use, and a RasCaller project, a simple WinForm with example code on using the package.

Both are written for .NET 1.1, though they compiles and should work fine under 2.0.

The project includes a RasPhonebook class for iterating over a PBK file (RAS Phonebook), a RasEntry for retrieving information about an entry, and a RasConnection in order to dial or hang up against a RasEntry.

There is no support for writing new phonebook entries simply because I didn't need that functionality. If you have any problems, do let me know.

Attachment: RasWrap.zip
Posted: Dec 13 2006, 04:27 PM by Avner Kashtan | with 3 comment(s)
Filed under: , ,

Comments

Mohammad Rastkar said:

Very helpful. Thanks.

# August 1, 2008 11:21 AM

Steve said:

Thanks Avner. This has helped me heaps even taught a couple of new things. Again thanks heaps.

# January 7, 2009 4:37 PM

Jeff Winn said:

I had the same problem not too long ago, so I decided to start writing components to handle this for me. It's been about a year in the works so far. If you're interested check out the DotRas project on CodePlex. I've pretty much got everything done already. :)

http://www.codeplex.com/DotRas

# March 5, 2009 2:35 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)