Solved

How to get Remote Host IP

Posted on 1998-02-01
8
373 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
 

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

809 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