Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
IP number and connection Posted by MFH on 12 Aug 2005 at 2:55 AM
Can somebody please tell me how to read the IP number of my computer with vb6 and how to verify if the connection with internet is on?
thanks
Report
Re: IP number and connection Posted by Bulgarian_VB on 13 Aug 2005 at 1:06 PM
: Can somebody please tell me how to read the IP number of my computer with vb6 and how to verify if the connection with internet is on?
: thanks
:
Put a WinSock control in your form. Then query its LocalIP proerty. That's you IP address.

If you want to check internet connectivity, just use a web site as a becnhmark. Tell the WinSock control to connect to ... Google, for example, like this:
WinSock1.Connect "www.google.com", 80 'Port 80 is for HTTP


If you have the Error event firing, then you most probably don't have internet connection. If, however, the Connect event fires, thn you have successfully connected to the internet. Don't forget to Close the connection to Google, using the Close method of the WinSock.

Hope I helped,
Nikolay Semov

Report
Re: IP number and connection Posted by MFH on 14 Aug 2005 at 7:02 AM
: : Can somebody please tell me how to read the IP number of my computer with vb6 and how to verify if the connection with internet is on?
: : thanks
: :
: Put a WinSock control in your form. Then query its LocalIP proerty. That's you IP address.
:
: If you want to check internet connectivity, just use a web site as a becnhmark. Tell the WinSock control to connect to ... Google, for example, like this:
:
: WinSock1.Connect "www.google.com", 80 'Port 80 is for HTTP
: 

:
: If you have the Error event firing, then you most probably don't have internet connection. If, however, the Connect event fires, thn you have successfully connected to the internet. Don't forget to Close the connection to Google, using the Close method of the WinSock.
:
: Hope I helped,
: Nikolay Semov
:
:
Where can I find the winsock control? What's the exact name?
However, many thanks.
Report
Re: IP number and connection Posted by Bulgarian_VB on 14 Aug 2005 at 3:39 PM

: Where can I find the winsock control? What's the exact name?
: However, many thanks.
:
The full name is "Microsoft Winsock Control <version>".

Or, you can hit the browse button and get %SYSDIR%\mswinsck.ocx.

Hope I helped,
Nikolay Semov

Report
Re: IP number and connection Posted by MFH on 15 Aug 2005 at 5:18 PM
:
: : Where can I find the winsock control? What's the exact name?
: : However, many thanks.
: :
: The full name is "Microsoft Winsock Control <version>".
:
: Or, you can hit the browse button and get %SYSDIR%\mswinsck.ocx.
:
: Hope I helped,
: Nikolay Semov
:
:
Well, I don't think this is normal but, ... I don't have this file. Is it possible to download it anywhere?
Report
Re: IP number and connection Posted by Bulgarian_VB on 15 Aug 2005 at 7:02 PM

: Well, I don't think this is normal but, ... I don't have this file. Is it possible to download it anywhere?
:
Happens. A resintall of Visual Studio 6 (VB only is enough) will bring it back. In this sense, you can try searching in the .CAB files on the first CD.

Or... just do a Google search on "mswinsck.ocx download" That's how I restored my copy after it misteriously vanished.

Hope I helped,
Nikolay Semov




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.