Solved

How to get Remote Host IP

Posted on 1998-02-01
8
377 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

696 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