Tuesday, 3 March 2009

.NET Remote Access Service (RAS) Wrapper Classes in C#. Use C# to access RAS API

I was writing a windows service that needed to access RAS, Dialup, Enumerate connections and create new ones using RASSetEntryProperties and the RASENTRY structure. I had the option of marshalling the calls from C++/CLI I was using but I found this RAS API wrapper
(http://weblogs.asp.net/avnerk/archive/2006/12/13/wrapping-the-ras.aspx)
written in C# by "StrawJackal"which at the time it seemed as if it was making life easier.
Well that changed a while later when it had to be extended to enable me to add new entries. After a lot of effort and corrections made to the previous code due to wrong constant values for RAS I made a more complete version of it which I am happy to share back with everyone,
Download RASWrapper.cs


P.S Thanks to Avner Kashtan (strawjackal) for the original effort and neat coding.

No comments:

Post a Comment