Solved

How to get Remote Host IP

Posted on 1998-02-01
8
370 Views
Last Modified: 2013-11-13
Hi all,

I am writing a control, that after being downloaded, will return the server IP that the client browser is connected to. I have tried using Winsock.RemoteHostIP but it gives me a blank string. What else should I do?

Any clues/help given is much appreciated please :)    
0
Comment
Question by:janeb
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 8

Expert Comment

by:mrmick
ID: 1454891
I am trying to figure out what exactly is the question.  Are you asking how to gain access to the browser's URL or are you asking how to parse the domain name from the URL or are you asking how to get an IP address from a known domain name?
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1454892
The winsock control actually has to be connected as a host for remotehostip to do something.   That's why that doesn't work.  I don't understand what you are asking.
0
 

Author Comment

by:janeb
ID: 1454893
Sorry for not making it clear.

When a html page (which has my ActiveX control embedded in it) is downloaded, I need the control to obtain the IP address of the server where the page is coming from. Are there any functions inside VB5 to do this? Or I need to use VBS or JS to read the IP then pass it into the control - that is if the scripts can do it.

Hope this is clearer, thanks!
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1454894
Are you using IIS 4.0 or 3.0 on the backend server?  If you are, you could use active server pages to create server side code that can get the IP, then pass it to your control.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:janeb
ID: 1454895
Thanks for the comment, but what if I'm using Unix platforms?
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1454896
I am not too up to speed on UNIX Webservers.
0
 

Accepted Solution

by:
HexMan earned 50 total points
ID: 1454897
You have to get the client IP just after the connection is made.
In the ConnectionRequest just after accepting the connection, then you can get the IP like:

othercomputer$ = Winsock1.RemoteHost
0
 

Expert Comment

by:HexMan
ID: 1454898
Oh, sorry, I thought you were writing a server program, not a client. I guess my answer isn't any help to you. Oh well
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now