This project is read-only.

sample code

Sep 26, 2011 at 6:37 PM

 Hi .  is there a bunch of sample code available for download (  ie.   .sln  working samples ) ..   my issue is  I struggle to understand documentation ... and my method  of  comprehending  is through examples .  I have seen the samples available in sdk pack ...   and I have seen the snippets in examples in the 'chm' documentation.  Example //  a  solution that demonstrates ,  displaying phone book entries, then  selecting and dialing a entry in the phone book  , then monitoring the status of that connection,  then disconnection of the dialed connection ....    I would appreciate and assistance...thanks - Trevor

Sep 27, 2011 at 7:45 PM

Unfortunately there will never be an example that does everything that the DotRas SDK is capable of doing. For example, some of the different VPN protocols supported by RAS are L2TP, PPTP, SSTP, and IKEv2 and that's not including all the dial-up variations. So when you ask for an example that dials an entry in a phonebook, that leaves a LOT to interpretation. Does the entry use a pre-shared key, where is it supposed to connect to... these are questions people typically expect answered within examples and ensuring the example fully functions out of the box means I'm going to have to keep a VPN server available with the accounts that I used in the examples. Even if I don't go that far and just create an example that works, it may not necessarily run on others machines because of permissions.

This is the fundamental reason why the examples in the DotRas SDK are just showing basic concepts on how the product could be used... they are not showing the only way DotRas can be used, they're just examples showing how DotRas could be used.

RAS is probably one of the most complicated features of Windows, and if you don't understand the basic concepts within RAS the DotRas SDK isn't going to be much to help you. You should be able to pick up the project, poke around a bit, and be able to write something that would provide basic functionality, but handling all the different scenarios presented by RAS rests entirely upon the developer that wants to interact with it.

Also, that sample you asked for sounds a lot like a fully functional app you'd just want to re-brand and deploy. While that might be the typical use of this SDK, it's not something I'd be willing to write or support.

Sep 28, 2011 at 2:27 AM

 Thanks any way Jeff...

p.s. I rarely  ask questions on forums, because of the abundance of samples programs/snippets available every where.    example/  VB.NET  101 samples etc.   / websites.

 Recently I got and android phone(never used Java before)  but with the  abundance of   resources/samples in Java , I was able to  write an application...  

I'll just  ask specific questions on this forum , to hopefully build up my understandings of dotras...

---- cheers

Sep 28, 2011 at 4:47 AM

I wish I could have given you the answer you wanted, but unfortunately there's just no way to cover every scenario that the SDK can handle. I'd have so many examples floating around that I'd spend more time maintaining them than actually adding value to the API.

You're basically looking at using RasPhoneBook for manipulation of a phonebook and displaying the entries on your user interface, a RasConnectionWatcher to monitor the status of connections, RasConnection to disconnect the connection, and a RasDialer to dial the connection. The project has been around for over 3 years now, so there may be some examples more closely related to what your specific needs are, but I haven't seen many people actually helping promote the project. Most of the time it's just download, use it, and that's it.

Learning a general purpose development language like Java would be quite easy to find examples, but in the case here you're looking for a very small subset of the .NET community that needs a project which integrate with RAS. If you have any specific questions I'll do my best to answer them, just be sure to search the SDK and on here before you ask so I don't have to answer something that's already been asked again. Your cooperation is appreciated!

- Jeff