| View previous topic :: View next topic |
| Author |
Message |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Wed Apr 17, 2002 11:42 am Post subject: |
|
|
Can someone write such a dll - please!
Serge _________________
|
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Wed Apr 17, 2002 1:47 pm Post subject: |
|
|
It isn't possible to determine an internet connection through any DLL in
the way you want it. As you mentioned it's possible that a firewall is
blocking certain requests, so you should first think about what you
consider being an internet connection, depending on the kind of
application you need. If you need to know if there's an internet
connection for accessing web pages, you should probably try to connect
to such a server through HTTP as Moke illustrated. If you need to know
whether it's possible to connect to any and all ports on the internet, a ping
should probably do. Some special internet connections might only allow
SMTP and POP3 access while blocking all other connection kind, so would
you consider that being an internet connection too?
The RAS DLL or some of the other methods will only work for modem
connections, so that's probably not what you want.
Tommy |
|
| Back to top |
|
 |
moke Contributor

Joined: 02 Jan 2002 Posts: 162
|
Posted: Wed Apr 17, 2002 3:49 pm Post subject: |
|
|
I agree with Tommy a computer cannot tell the difference between a TCP/IC network connetion an internet conection. It simply sees a network connection. You would need to test each port for each application HTTP, SMTP, FTP etc. to determine whether or not it is accessable through the network connection. They must be tested through an external reference point also since the protocols could run internally but be blocked by the firewall or by using IP port blocking at the router. You need to test for what your application needs are.
moke |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Apr 17, 2002 10:12 pm Post subject: |
|
|
I use the VDSIPP.DLL to periodically check my email,
but I had to give the program internet access thru Zone
Alarm. And if I make changes to the program and re-compile
it, Zone Alarm prompts for access again (apparently ZA
does a file check). It also does this with my program that
uses the DOS PING command.
My point is this: a firewall on a user's computer probably
isn't going to allow your program to ping, access the internet
by http, or anything else without the users permission...
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Apr 18, 2002 11:04 am Post subject: |
|
|
Thanks for all your comments and thoughts.
I used IPCONFIG at work and found that it does return an IP from the network even if not connected to the net and hence can't use it to determine access to the net.
Version 5 of VDS apparently will have some Internet support, perhaps it will have what i need.
Thanks again all for your help,
Serge _________________
|
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Thu Apr 18, 2002 11:32 am Post subject: |
|
|
Did you try my demo that I posted ?
I know it`s not a DLL but it works ok for me.
 |
|
| Back to top |
|
 |
Serge Professional Member


Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Thu Apr 18, 2002 11:44 am Post subject: |
|
|
No because i thought that it worked like the dll mentioned earlier in this post
I'll take it to work tomorrow and see if it works for a computer that has a permanent connection to the net through the network.
The problem is that i need to be able to test if a computer is connected to the net in less than 1 sec, whether the computer is networked or not - does your demo do that? Like i said, i'll test it tomorrow.
Thanks for suggesting it again,
Serge _________________
|
|
| Back to top |
|
 |
mrfloppy Newbie
Joined: 17 Apr 2002 Posts: 1 Location: england
|
Posted: Thu Apr 18, 2002 7:55 pm Post subject: i found this |
|
|
Here something long time ago i found in Win9/x registry
when dialup connects to inet it make registry changes in hex 00 > 01
ndetect.exe from icq use this long time ago to check if comp was connected to net, but i think icq change the process to win system dll files
:/
--- OFFLINE ---
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\RemoteAccess]
"Version"="1.2c"
"NoLogon"=hex:00,00,00,00
"Remote Connection"=hex:00,00,00,00
--- ONLINE ---
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\RemoteAccess]
"Version"="1.2c"
"NoLogon"=hex:01,00,00,00
"Remote Connection"=hex:01,00,00,00 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Apr 19, 2002 1:25 am Post subject: |
|
|
This is turning into quite an interesting thread!
Well, anyway I had a go at it using a couple of PGWARE's DLLs (vdsonline + vdsipp). This proggie
checks the local IP first - if there's only the localhost address 127.0.0.1 then the computer is
offline. If the computer owns another IP then the program makes a ping to a host on the Internet
to try to find out whether the computer is really hooked up to the Net or just on an Intranet etc.
(Use a reliable, fast host). It is not necessary to save any ping output to disk or evaluate it very
much because if the ping returns 'Unknown host' for a well-known host then the computer is most likely
off-line.
Still some caveats: A firewall may block the ping, a proxy may screw things up etc.
Greetz
Dr. Dread
| Code: | external vdsonline.dll
external vdsipp.dll,DEMO
option decimalsep,"."
title On-line status
dialog CREATE,On-line status .. by Dr. Dread,-1,0,300,92
dialog ADD,TEXT,Netstatus,10,30,,,
dialog ADD,TEXT,Local,35,30,,,
dialog ADD,BUTTON,showip,62,102,100,,Check status
dialog SHOW
:evloop
wait event
goto @event()
:showipBUTTON
dialog set,Netstatus,
dialog set,Local,
rem Check if local IP is 127.0.0.1 - then there is no connection and we skip the rest
%%local = @online(getip)
if @equal(%%Local,127.0.0.1)
dialog set,Netstatus,Not connected to the internet
goto evloop
else
list create,1
gosub ping
list close,1
dialog set,Local,Local IP = %%Local
dialog set,Netstatus, %%Netstatus
end
goto evloop
:Close
exit
rem ############## SUBs ################
:ping
list clear,1
REM Try a ping to see if a known, stable server is up
REM Checks for the message 'Unknown host' - if a non-existing
REM host name is used the reading will be false
INTERNET ICMP,CREATE,1
INTERNET ICMP,THREADS,1,OFF
INTERNET ICMP,TIMEOUT,1,200
INTERNET ICMP,PING,1,google.com,
%M = @INTERNET(ICMP,MESSAGE,1)
INTERNET ICMP,DESTROY,1
list add,1,%M
if @match(1,Unknown host)
%%Netstatus = This computer is offline
else
%%Netstatus = Connected to the Internet!
end
exit |
_________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Fri Apr 19, 2002 3:30 am Post subject: |
|
|
What about mrfloppy's idea? It works for me on Win 98 with dial-up..would it work elsewhere?
You might also let the user specify whether they have dial-up or a dedicated connection. That way you pretty much don't have to check whether they are online or not if they are dedicated. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Apr 19, 2002 6:29 am Post subject: |
|
|
| SnarlingSheep wrote: | What about mrfloppy's idea? It works for me on Win 98 with dial-up..would it work elsewhere?
You might also let the user specify whether they have dial-up or a dedicated connection. That way you pretty much don't have to check whether they are online or not if they are dedicated. |
Reading a registry value would of course the far the easiest. On my XP system the keys
mentioned by Mrfloppy do not exist, unfortunately. I searched for the key names also, but
they aren't elsewhere either. I don't know whether this is due to XP or to the fact that I'm
not using a dial-up connection.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Fri Apr 19, 2002 7:55 am Post subject: |
|
|
_____________________________________________________________
Just curious... Has anyone tried the @match() WINLIST
example I posted on an OS other than Windows 95?
It picks up the dialup "Connected to..." window even when
it's only in the sys tray (the two little computers icon).
Also, do cable modems etc. have a similiar window (or some
other indicator for the user) when connected?
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Apr 19, 2002 8:12 am Post subject: |
|
|
| Mac wrote: | _____________________________________________________________
Just curious... Has anyone tried the @match() WINLIST
example I posted on an OS other than Windows 95?
It picks up the dialup "Connected to..." window even when
it's only in the sys tray (the two little computers icon).
Also, do cable modems etc. have a similiar window (or some
other indicator for the user) when connected?
Cheers, Mac  |
Hi, Mac!
Yup, I tried it. I have an ADSL connection - runs as network connection, not dial-up. I can have an
icon for this connection in the tray if I tell my XP system to give me one. It is named "Connections
Tray" but it will stay there no matter if I'm connected to the Internet or not.
So probably that's another great idea gone down the drain.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
marty Professional Member


Joined: 10 May 2001 Posts: 789
|
Posted: Fri Apr 19, 2002 11:21 am Post subject: |
|
|
| Quote: | Just curious... Has anyone tried the @match() WINLIST
example I posted on an OS other than Windows 95?
It picks up the dialup "Connected to..." window even when
it's only in the sys tray (the two little computers icon).
Also, do cable modems etc. have a similiar window (or some
other indicator for the user) when connected?
Cheers, Mac |
I have cable and there's no icon in the systray, and as for DSL, well there's a different icon than the one from windows. I guess because of the PPPo thing.
Anyway did someone try the demo I made with VDS and cmdnet.exe???
The demo works great for me here. I have a permanent connection to the internet and it gives me both my Public IP (main internet IP) and the local one (LAN). If I cut off my internet connection by disabling it in network neighboorhood it. It tells me "Not connected" for the public IP. But I still get my local (LAN) IP. The demo retreives the info in about 1 second...
Could you try it guys and let me know if it works on your side. thanks...
 |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Apr 19, 2002 12:57 pm Post subject: |
|
|
| marty wrote: |
Anyway did someone try the demo I made with VDS and cmdnet.exe??? |
Hi, Marty!
I checked it out. It works fine here on my computers, one XP connected directly to an ADSL line
and one W98 connected to ADSL through a router (so this one has a local and a public IP).
As far as I can tell the CMDNET prog connects to a web site to read the public IP part. This can of course
also be done with the VDSIPP dll - one will need to call a webserver that can return the public IP.
That's easily done for instance with a very simple PHP script or a Perl script like this (to be run
on the server):
#!/usr/local/bin/perl
$IP = $ENV{REMOTE_ADDR};
print "Content-type: text/html\n\n";
print "<HTML><BODY>|$IP|</BODY></HTML>";
When called with a browser or the HTTP protocol of VDSIPP it will return your public IP. Easily parsed with VDS.
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|