|
i want to use this , but i don't know how to use it,
how to create to a new Connection?
and how connect this connnection?
in fact , i need create a vpn client. use itselef account,
my email: lovebanyi at 163.com
if you see this message ,please send a email to me
Thank you
我该什么用这个类库呢?我不清楚什么去用它.
什么去创建一个连接.
什么去连接创建好的连接.
我想要的是创建一个vpn连接,并用它的帐号连接它.
我的邮箱 lovebanyi@163.com
如果你有看到这个消息就发一封邮件给我吧.谢谢
|
|
|
|
|
vpn isnt included in this solution
connect:
Ras.RasConnection rasConn;
rasConn.PhoneNumber = "110";
rasConn.UserName = "user";
rasConn.Password = "pw";
rasConn.CallbackNumber = "";
rasConn.Domain = "";
rasConn.Dial();
|
|
|
|
|
HI I am trying to use your demo project but facing error
Additional Information: text lenght must be less than 64 characters long
is any solutions please..
thanks
|
|
|
|
|
Hey, there is a problem when there are error messages longer than 64 characters. Therefore you have to shorten the text which goes to these notification icons (on the taskbar). The code therefore is within Form1 on line 748. I changed it to:
string rasNotifyText = (string.Format("{0},{1}", e.ConnectionState, e.Message));
this.rasNotify.Text = (rasNotifyText.Length > 63) ? rasNotifyText.Substring(0, 63) : rasNotifyText;
Quick and dirty, but it works
|
|
|
|
|
Hi,
All works me well with WINVER4 WINVER5.
When I define WINVER501, I get exception: Error 632 - Incorrect Structure Size.
Can somebody help with this problem?
I need setup functionality accessible in WinXp.
thank you Petr Synek
|
|
|
|
|
I'm getting the same error. Any help would be appreciated!
|
|
|
|
|
I found the problem here:
#if WINVER4
RAS_MaxEntryName =256,
RAS_MaxDeviceName =128,
RAS_MaxCallbackNumber =RAS_MaxPhoneNumber,
#else
RAS_MaxEntryName = 20,
RAS_MaxDeviceName = 32,
RAS_MaxCallbackNumber = 48,
#endif
According to http://billmccarthy.com/Projects/Archived/PlatformVB/dun/rasenumdevices.htm, the RAS_MaxDeviceName should be 128 for Winver4 *OR LATER* - in this case, it will only be set to that on Winver4, later versions will try and use 32. I changed the 32 to 128 and it ran fine...
|
|
|
|
|
hey, I need to connect to a PPP ISP, how do I do that with this code???
I do not have a phone line to test it with, but it does connect and try to dial through the modem just fine.
what other steps must be taken to connect to an ISP ?? thanks.
It's not a bug it's a f- oh wait... no..It's a bug.
|
|
|
|
|
Hi all,
can any one help me on this issue. If we set RasEntry options with bit that sets mentioned flag to 0 (we just don't specify it), code ignores that and created entry has this option under TCP/IP settings enabled. Bummer. Does anyone know why or how to correct this? Other flags seem to be OK.
I believe that author of this code uses 0x3d0d0318 as entry options. Try changing it to 0x3d0d0308 and observe.
|
|
|
|
|
Hi
I am working on a project to develop a VPN Dialer using RAS.dll, here is the Code
Conn.PhoneNumber = "10.101.10.1";
Conn.Phonebook = "C:\\Documents and Settings\\All Users\\Application Data\\Microsoft\\Network\\Connections\\Pbk\\rasphone.pbk";
Conn.UserName = "hassaan";
Conn.Password = "nothing";
Conn.Connected += new EventHandler(Conn_Connected);
Conn.Error += new RasErrorEventHandler(Conn_Error);
Conn.Disconnected += new EventHandler(Conn_Disconnected);
Conn.DialNotify1 += new RasDialNotify1EventHandler(Conn_DialNotify1);
Conn.Dial();
but i am keep getting the Error message "The Modem or the connecting Device is already in use, or is not configured Properly"
Hoping for earliest helping reply
Thanks
|
|
|
|
|
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.....
|
|
|
|