Desmond
10-03-2003, 12:10 PM
<HTML> <HEAD> <TITLE>AutoPlay Media Studio 5.0 Knowledge Base</TITLE> </HEAD> <BODY> <h3>Determining if Internet Access is Available</h3> <b>Document ID: IR10075</b> <hr> The information in this article applies to: <ul> <li>AutoPlay Media Studio 5.0 Professional Edition</li> </ul> <hr> <h3>SUMMARY</h3> <p>This article describes how to determine if internet access is available.</p> <h3>DISCUSSION</h3> <p>If your application utilizes the Internet in any way, you can check to ensure that the user has internet access before continuing, and if they do not, prompt the user to connect.<br> <br> To accomplish this in AutoPlay Media Studio 5.0, enter the following script into an event in your application:<pre><code>connected = HTTP.TestConnection("http://www.indigorose.com", 20, 80, nil, nil);
<br />if connected then
<br /> --Insert your internet related action here
<br />else
<br /> Dialog.Message("Internet Error", "You are not connected to the internet. Application will now exit");
<br /> Application.Exit();
<br />end</code></pre> This script checks if the user is connected to the Internet. If after 20 seconds the program cannot find a valid internet connection, it notifies the user, and exits. <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:</p> <ul> <li><b>Program Reference | Actions | HTTP | HTTP.TestConnection</b></li> </ul> <p>KEYWORDS: AutoPlay Media Studio 5.0, HTTP, Internet, Detect Connection </p> <hr> <FONT SIZE=1> Last reviewed: October 3, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>
<br />if connected then
<br /> --Insert your internet related action here
<br />else
<br /> Dialog.Message("Internet Error", "You are not connected to the internet. Application will now exit");
<br /> Application.Exit();
<br />end</code></pre> This script checks if the user is connected to the Internet. If after 20 seconds the program cannot find a valid internet connection, it notifies the user, and exits. <h3>MORE INFORMATION</h3> <p>For more information please see the following topics in the AutoPlay Media Studio 5.0 help file:</p> <ul> <li><b>Program Reference | Actions | HTTP | HTTP.TestConnection</b></li> </ul> <p>KEYWORDS: AutoPlay Media Studio 5.0, HTTP, Internet, Detect Connection </p> <hr> <FONT SIZE=1> Last reviewed: October 3, 2003<br> Copyright © 2003 <A HREF="http://www.indigorose.com" target="blank">Indigo Rose Corporation</a>. All rights reserved.<br> </FONT> </BODY> </HTML>