Click here to Skip to main content
15,891,136 members
Articles / Programming Languages / C#
Article

How to using Remote Access Service on DotNet

Rate me:
Please Sign up or sign in to vote.
4.56/5 (50 votes)
16 Apr 2005 462.4K   8.4K   39   67
A RAS dial sample

Introduction

    

My English is very pool!The 100 words is too difficult for me! So sorry!



    This is an example for the Remote Access Service,about how to using Rasapi32 on DotNet which to dial and connection a RAS Server.
    The demo project is writing by C# on VS.Net. It is including RasConnection component.This component contain dial and handup method to control client computer's modem to connect or disconnect RAS Server,and watch the dialing & connection status.

    

My English is very pool!The 100 words is too difficult for me!So sorry!


License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Error 632 - Incorrect Structure Size Pin
jmbillings14-May-08 0:21
jmbillings14-May-08 0:21 
Questionhow do I connect to PPP ISP??? Pin
roger_2728-Dec-06 9:53
roger_2728-Dec-06 9:53 
QuestionRASEO_RemoteDefaultGateway flag ignored when creating Ras Entry Pin
|ZUTI|30-Nov-06 2:51
|ZUTI|30-Nov-06 2:51 
QuestionVPN Dialer Pin
Syed Hassaan Ahmed27-Oct-06 12:30
Syed Hassaan Ahmed27-Oct-06 12:30 
Generaltime for automatic disconnect Pin
DaViD8216-Aug-06 23:03
DaViD8216-Aug-06 23:03 
GeneralRe: time for automatic disconnect Pin
stiwoxxl23-Oct-07 5:01
stiwoxxl23-Oct-07 5:01 
QuestionWhat about firewall and vulnerability Pin
darioemit3-Aug-06 3:54
darioemit3-Aug-06 3:54 
QuestionThere is a problem if Raserrors occurrs Pin
THaala1-Aug-06 4:10
THaala1-Aug-06 4:10 
Hi.
Your code is very helpful - thank you for propagation.

It seems there is a problem. I switched of ISDN cable of my modem. After that i dialed up some Dialer. I got first an error 680 "No Dialtone" - that's ok - but i didn't get it through the error event. I can fetch it only by analyzing the dialnotify1 - events. The error occurrs after the portopen status. After that i hung up and dial again. From this point i go always error 756 "this connetion is beeing dialing" At the same point of time i opened the network conections in winXp and i cannot start or stop that dialer - because its in a pending state.
If i stop and restart my program the problem disapears - for exact one dialup. After deugging i discover that the Wrapper - Hangup - function does not call the real RAS.Hangup due to an former error which describes the handle as invalid. But the RAS - Hangup function must be called at least once because of freeing ressources inside the rasapi32.dll. After a quick and dirty solution which ensures a call to RAS.Hangup one time after a Call to Dial() the problem disapears.

Hope this will help
Best regards
Knoepfle

Knoepfle

AnswerRe: There is a problem if Raserrors occurrs Pin
paulains18-Sep-06 9:46
paulains18-Sep-06 9:46 
GeneralConnect via ras C# over wan Pin
davidabt9-May-06 5:57
davidabt9-May-06 5:57 
QuestionNewbie in using RAS Pin
denpsia30-Nov-05 14:19
denpsia30-Nov-05 14:19 
AnswerRe: Newbie in using RAS Pin
xae12-Feb-07 4:56
xae12-Feb-07 4:56 
GeneralPlease do not purge this article Pin
Paul Farry27-Sep-05 21:09
professionalPaul Farry27-Sep-05 21:09 
GeneralRe: Please do not purge this article Pin
xae13-Feb-07 6:20
xae13-Feb-07 6:20 
Generalthanks Pin
paulains4-Apr-05 10:50
paulains4-Apr-05 10:50 
GeneralRe: thanks Pin
Sparhauk12-Apr-05 16:39
Sparhauk12-Apr-05 16:39 
GeneralRe: thanks Pin
paulains14-Apr-05 6:45
paulains14-Apr-05 6:45 
GeneralRe: thanks Pin
Zeeshan Gulzar15-Feb-06 19:58
Zeeshan Gulzar15-Feb-06 19:58 
General1000 times thank you!!!! Pin
Dahoolio22-Mar-05 23:26
Dahoolio22-Mar-05 23:26 
GeneralNeed Ur Help Pin
Jeeva S14-Nov-04 19:44
Jeeva S14-Nov-04 19:44 
GeneralNeed Ur Help Pin
Jeeva S14-Nov-04 19:44
Jeeva S14-Nov-04 19:44 
QuestionWhat happened to the demo code? Pin
Member 84878330-Aug-04 22:11
Member 84878330-Aug-04 22:11 
QuestionVPN? Pin
CristianC8-Mar-04 10:18
CristianC8-Mar-04 10:18 
AnswerRe: VPN? Pin
linminxia30-Apr-04 4:56
linminxia30-Apr-04 4:56 
Questiontiming connection using the RAS? Pin
rantic6615-Feb-04 16:18
rantic6615-Feb-04 16:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.