Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
I have multi IP addresses. 1) IP- local innet (In...
Author:
766e4@mail.com
E-mail:
Click to e-mail author
Submitted:
3/2/2001
Version:
VB5
Compatibility:
VB5, VB6
Category:
Internet Programming
Views:
16726
I have multi IP addresses. 1) IP- local innet (Intranet) address 2) IP -internet address. Microsoft Winsocket object not have multi IP addresses.My code can have multi ip address. 1- code have Internet server. 2- code show display internet IP address.
Declarations:
'none
Code:
'Code 1 --------------------------------- Winsock1.LocalPort = 139 Winsock1.Protocol = 0 'Not write in function Winsock1.Bind '-"Winsock1.LocalIP" Winsock1.Bind Winsock1.LocalPort ', Winsock1.LocalIP Winsock1.Listen 'In table Routing one address always Dial-up (if in 'table Routing not have other write). 'When Dial-up call and have IP address , that table 'Routing auto write by first IP adress. 'And Winsocket ,if not write "Winsock1.LocalIP" always 'have by first IP address --------------------------------- 'Code 2 1- winsocket1 have 127... ip (or other IP -intranet) and "winsocket" event BIND (example PORT 1025). ------------------------------- Winsock1.LocalPort = 1025 Winsock1.Protocol = 0 Winsock1.Bind Winsock1.LocalPort , Winsock1.LocalIP Winsock1.Listen ------------------------------- 2- winsocket2 have INTERNET ip and "winsocket" event Coonect "winsocket1 port 1025" ----------------------------- Winsock2.LocalPort = 0 Winsock2.Protocol = 0 Winsock2.RemoteHost =Winsock1.LocalIP Winsock2.RemotePort =Winsock1.LocalPort Winsock2.Connect ----------------------------- 3-winsocket1- event "accept" a loock "REMOTEHOSTIP" and "winsocket" show display you internet IP address. ----------------------------- Sub Winsock1_ConnectionRequest(ByVal requestID As Long) If Winsock1.State <> sckClosed Then Winsock1.Close Winsock1.Accept requestID Text1.Text=Winsock1.RemoteHostIP Winsock1.Close ---------------------------
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement