|
-
Mar 16th, 2001, 07:37 AM
#1
Thread Starter
New Member
I have some code from VB that checks the wininet.dll file using the lib function as below:
Public Declare Function InternetGetConnectedState Lib "wininet.dll" (ByRef lpSFlags, ByVal dwReserved ) End Function
Can this be done in VBscript, I'm having a tough time finding any information on this.
The goal is to retrieve the connection flags from the dll to verify someone's online status.
Any help much appreciated.
Thanks,
Rossco
-
Mar 16th, 2001, 01:09 PM
#2
Lively Member
Hi,
I am sorry to say that u cannot access a System lib through vbscript, this is because IE doesn't allow this due to security issue.... so the other way arround is access the lib using VB DLL function and call this DLL function from VBSCRIPT... i hope this helps
Sonia
-
Mar 17th, 2001, 11:15 AM
#3
Fanatic Member
If your target is IE5, then you can determine the connection with the client Caps behavior. I have a sample, it's just i can't find my book CD, so i don't want to type it in if it's not what you want
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Mar 19th, 2001, 09:04 AM
#4
Thread Starter
New Member
Thanks harsoni and gwdash...
Thanks for the help!
gwdash, if you have an example for me to use, I'd love to see it.
Thanks again,
Rossco
-
Mar 19th, 2001, 07:06 PM
#5
Fanatic Member
ok, here goes
Code:
<HTML xmlns:IE>
<HEAD>
<STYLE>
@media all {
IE\:clientCaps {behavior:url(#default#clientcaps)}
}
</STYLE>
<SCRIPT>
function showConnectionType() {
var thisConnection = oClientCaps.connectionType;
if (thisConnection == "lan") {
alert("You are on a LAN (network) connection");
} else {
if (thisConnection == "modem") {
alert("You are on a modem (dial-up) connection");
} else {
alert("You are borwsing in offline mode");
}
}
}
</SCRIPT>
</HEAD>
<BODY>
<IE:clientCaps ID="oClientCaps" />
<SCRIPT>showConnectionType()</SCRIPT>
</BODY>
</HTML>
I did not write this code. All credit goes to the athors of the book Microsoft© Internet Explorer 5 Unleased
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|