Click here to Skip to main content
15,903,523 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 463.2K   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

 
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 
I had noticed after a similar scenario to what you speak of, Ras.RasHangUp would never be called from within RasConnection.HandUp (sic), because after assigning
res=Ras.RasGetConnectStatus(_Handle,status), res would always equal 6, meaning the conditional statement following it would be skipped and Ras.RasHangUp would never be called. So after that first res=Ras.RasGetConnectStatus(_Handle,status) line I added res=0, so it always tries to call the HangUp function. I haven't figured out why RasGetConnectStatus doesn't like the handle while RasHangUp does. I think it has something to do with the connection terminating before a RasHangUp is even called, and so the natural assumption is that you shouldn't have to hang up. But as it says in the RasDial documentation, "An application must eventually call RasHangUp..." Anyway, you shouldn't need to use the initial RasGetConnectStatus if you properly alternate between Dial and HangUp on the same connection.
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 
GeneralAlternate Numbers Pin
philg800030-Jan-04 2:17
philg800030-Jan-04 2:17 
GeneralRe: Alternate Numbers Pin
xae13-Feb-07 4:52
xae13-Feb-07 4:52 
GeneralHelp for ISDN modem Pin
Member 28562316-Jan-04 10:33
Member 28562316-Jan-04 10:33 
QuestionHow to find out username and password Pin
olreit27-Nov-03 5:25
olreit27-Nov-03 5:25 
AnswerRe: How to find out username and password Pin
roger_2729-Dec-06 8:08
roger_2729-Dec-06 8:08 
QuestionHow can we find out the modem type Pin
Armoghan Asif21-Sep-03 5:02
Armoghan Asif21-Sep-03 5:02 
AnswerRe: How can we find out the modem type Pin
stiwoxxl23-Oct-07 3:41
stiwoxxl23-Oct-07 3:41 
QuestionHow Connect PPPoE Pin
liangpz_200025-May-03 16:08
liangpz_200025-May-03 16:08 
Generalproblem if I use an existing dun Pin
Spagna7-May-03 22:53
Spagna7-May-03 22:53 

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.