| View previous topic :: View next topic |
| Author |
Message |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Dec 01, 2003 6:32 am Post subject: Check for Live Connection b4 Browser Call Question |
|
|
Would like to verify connection with a simple script. The One below creates error upon exit. Assistance requested and very much appreciated.
All feedback welcomed, thanks, nt
| Code: |
REM Browser DLL
external vdsbrw50
REM VDS STUDIO DSU
external vdstcp50
#include vdstcp50.dsu
gosub IPCHECK
DIALOG CREATE,Browser Test,-1,0,520,370,,,,,,
DIALOG ADD,BROWSER,BROWSER1,270,0,520,100,http://google.com,REFRESH
DIALOG SHOW
goto loop
:DIALOG_TWO
DIALOG CREATE,Browser Test,-1,0,520,270,,,,,,
DIALOG SHOW
:loop
wait event,
%E = @event()
goto %E
:Close
STOP
:IPCHECK
REM My Website
PING 209.15.9.40
if @ok()
exit
else
goto DIALOG_TWO
end
|
|
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Dec 01, 2003 2:41 pm Post subject: |
|
|
I've used a variety of methods, since some firewalls won't open a connection in response to a ping. But if ping works for you, then my code for it is:
| Code: | repeat
%I = @succ(%I)
PING %2
until @ok()@greater(%I,20)
if @not(@ok())
log Unable to reach %2
end |
I've gound getting a web page to be a more reliable method, like this:
| Code: | list create,1
%I = 0
repeat
%I = @succ(%I)
http get,%2,1
until @ok()@greater(%I,10)
if @not(@ok())
log Unable to reach %2
end
list close,1 |
Finally, for machines with dial-up networking, you can use the VDS RAS extension to see if a dial-up connection is connected. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
noveltech Contributor

Joined: 16 Sep 2002 Posts: 105
|
Posted: Mon Dec 01, 2003 3:04 pm Post subject: Jules, is there a script that would suffice for both? |
|
|
Thanks, Jules for the feedback. Is there a script that would suffice for both or most of the connection possibilities?
It seems that most of us? are attempting to create software that would help us in this money world.
Shareware is the method that most of us are attempting?!
While the prog is unregistered, we could have a browser at the bottom of the main dialog window...prompting for registration, offering inticements, or advertising purposes.
Creating the browser seems to be simple , however, checking for connection and getting the browser to use offline content if no connection is avail is not so simple! <<For me anyway!
The browser window should check for new content and download the new content, save uploaded html file in html format, and use the {downloaded} local file on local cpu as offline content.
Using "if reg" code. the browser would be bypassed by prog if registered.
The above represent my thoughts at the moment...
If the more talented VDS programmers could create such a DSU or DLL...I would be willing to buy it.
VDS code is great...but I'm aging pretty quick. I would like to get a working model together b4 I begin to lose "more" of my short term memory.
I would just as soon purchase as many modules {DSU} as needed as long as it does the job. Better, would be the scripts? unless we can inbed the dsu into the exe's. As in RESOURCE ADD.
I covet everyone's thoughts, thanks, nt...  |
|
| Back to top |
|
 |
CodeScript Moderator Team

Joined: 08 Jun 2003 Posts: 1060 Location: India
|
Posted: Tue Dec 02, 2003 6:22 pm Post subject: |
|
|
| noveltech wrote: | | Better, would be the scripts? unless we can inbed the dsu into the exe's. |
The DSUs are nothing but VDS codes which are in a precompiled form. So it is added to the exe just as any other code you typed in the IDE.
To check if there is any active connection you can try this DSU. It nedds no additional dlls. It is said to work on LAN internet connections although I have not tested. Try if it suits your need
http://www.vdsworld.com/index.php?page=download&fileid=328
Place the dsu in the same folder as your script then:
In your script
| Code: | #INCLUDE INET.dsu
%A = @INET(CheckConnection)
IF @NOT(@ZERO(%A))
REM Internet Connection is present
REM So Your code goes here
REM For Example
INFO Active Internet connection Present !!
END |
Please note that some firewalls may create a problem although I haven't tested. _________________ Regards
- CodeScript
Give your application a professional look with the VDSGUI Extension
Last edited by CodeScript on Tue Dec 02, 2003 6:45 pm; edited 2 times in total |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Tue Dec 02, 2003 6:26 pm Post subject: Re: Jules, is there a script that would suffice for both? |
|
|
The bits of code I gave you came from the dialer program that comes with my new mail server (see Tech-Pro Mail Server at http://www.tech-pro.co.uk/tpms.html).
What your trying tp do is a bit more tricky, as it's difficult to test for a connection without opening one. You can do it on a PC that has Dial Up Networking installed, but an increasing number of people are using broadband routers and the like where the Internet connection is opened and closed by a separate device.
Gotta go. _________________ The Tech Pro
www.tech-pro.net |
|
| 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
|
|