|
hello,
where can I parameter the time for the automaticle disconnect.
my problem is, that i activate the connection, and after I think 60-80 seconds the connection will be disconnected. there is no traffic during this time.
|
|
|
|
|
RasEntry.IdleDisconnectSeconds = 300;
|
|
|
|
|
I'm using this good Ras connection, to establish a gprs connection, and I encoutered vulnerability problems.
Infact this ras connection doesn't use the windows firewall, even tought I have enabledit manually on the windows' connection panel.
Never the connection notification, on the Network connections windows,seems to be related to the connection established via SW.
So I'm on Network without any protection.
Any ideas on how to protect me on this connection, programmatically?
Thanks
DE
DE
|
|
|
|
|
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
|
|
|
|
|
See my comment below, with the subject "Thanks". I had to do the same thing you did - ensure that RasHangUp gets called. I too wonder what that error is that makes the handle invalid.
|
|
|
|
|
Was wondering how to use this code to connect over the internet. I don't use a modem.
Dave A.
|
|
|
|
|
Hi everybody,
Is there any modification be made if I am using a GPRS modem? Is this the same function as a Network Connection created to connect to a remote server like creating a connection to a local ISP server? How would I used this for me to be able to connect and process sql statements database on a remote location? Please Help me. Thanks.
What I like to do is to allow the class to connect, access and do data process with a remote sql database without using any server components. So, I do not need the GUI part of this demo, basically I like to connect to this remote server and be able to access and interact with its sql database.
Is the PhoneBook a requirement as paramter in RASDial() of rasapi? Can it be null?
denpsia
-- modified at 22:53 Wednesday 30th November, 2005
|
|
|
|
|
i'm pretty sure that if you set the phonebook to null, it will try to use the default one.
|
|
|
|
|
Whilst the english in the article may be lacking.
The code available in this component is very good. (the code, not the comments).
|
|
|
|
|
|
This code helps out greatly in my goal to programmatically connect to the Internet. I had to modify the RasConnection.HangUp() and remove that first RasGetConnectedState it calls, as I discovered that with it, Ras.RasHangUp never actually gets called if I try to make a RAS connection when my device isn't turned on (I first use RasConnection.Dial(), but with RAS you have to hang up before you can attempt another dial). So now it's able to reattempt dialing without saying "This connection is already being dialed." Other than that your class is working quite nicely.
|
|
|
|
|
Please clarify what you did to get the HangUp to work correctly. I have been fighting with this for several weeks. Every time I get a busy signal or no answer, the connection won't work again, and since I have this running as a service, it requires me to spend a lot of time baby sitting it.
Thanks,
Jeff Hill
|
|
|
|
|
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.
|
|
|
|
|
I am facing the same problem. but when i modify the conditional statment
so not check res value and just check the state, conditional statment becomes true and call RasAPI.Handup(...), the stopthread() method still alive and wait at WaitAny(...) but this thread never expire even after calling handup() due to exception in handup when calling RasAPI.Handup(...). So resources is still used without any work.
Zeeshan
|
|
|
|
|
I really love your example, it has all the gimmicks in it i can use for my own project!
I credit you in my project!
Many thanx!!;)
If you make something idiotproof, someone else will make a better idiot.....
|
|
|
|
|
I need ur help..
plz give me ur email..
my email id is
vavjeeva@gmail.com
Keep Smile Always
|
|
|
|
|
I need ur help.. vavjeeva@gmail.com
Keep Smile Always
|
|
|
|
|
The link is dead, can author fix or someone else supply?
"How to using Remote Access Service on DotNet"
Thanks,
|
|
|
|
|
Nice code. But i'm trying to use it to connect to a VPN server.
And I only get a error message..
Any suggestion on differences with doing RAS calls to PPTP. Should this work or do I have to change the code?
CC
|
|
|
|
|
Easy.
just add the entryname & phone book file to the rasdial.
looks like:
RasDial(null,"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk",_Params,1,_DialNotifyDelegate,ref _Handle);
the keys are:
1. need to add the entryname in _Params, that is the entryname, not a connection manager name, very important.
2. use IP instead the phone no in _Params.
3. the phone book name.
and you get it.
Still some errors somewhere. but definitely Cool code. thanks a lot.
|
|
|
|
|
hi,
the demo code is great, but could u give an example of how to detect that a connection has been made to an ISP/server, and how to detect that it has been terminated.
thanks
rt
|
|
|
|
|
I am using Windows XP as my development machine. I have found that the alternate numbers are not loading properly after making a call to the RasGetEntryProperties. I have tried several things to get it to work. I have not modified the code given. Any suggestions??
|
|
|
|
|
in the actual pbk file, it's just adding 2 additional numbers even though i didnt specify them, and calling them "ack" and something else, garbage data...
any ideas of how to fix? I even try doing rasEntry.AdditionalNumbers.clear()
|
|
|
|
|
Does anybody use this code for ISDN modem and how?
I try but unsuccessful .
smac
|
|
|
|
|
I want to dial automaticly to the internet using rasapi32.dll. My problem is, that I don't want to ask the user for his username and password. Is it possible the get these information automaticly?
|
|
|
|