Click here to Skip to main content
15,895,746 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I need a code that takes address from browser (only highlited one Ex:www.google.com instead of www.google.com?id-712hh2hadsadasdsduh2) and find its ip by performing any operation on address.please help me please....please I will be thankful to one who send me reply..please.please
Posted
Updated 27-Feb-14 18:35pm
v4
Comments
Sergey Alexandrovich Kryukov 27-Feb-14 11:38am    
What's wrong with just reading/searching of standard MSDN documentation?
—SA

I have no idea why would you need to get address from browser (not sure this is what you really need), but everything you are asking about is easy.

Parsing URL to remove query parameters: http://msdn.microsoft.com/en-us/library/system.uri%28v=vs.110%29.aspx[^].

Just create the instance of System.Uri using the constructor with as string parameter, and use the properties to read the parts of URI you need.

And for pinging, use the class, not to much of surprise, System.Net.NetworkInformation.Ping:
http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping%28v=vs.110%29.aspx[^].

[EDIT]

To find IP by URI, you need to act as a client of DNS: http://en.wikipedia.org/wiki/DNS[^].

This is how: http://msdn.microsoft.com/en-us/library/system.net.dns%28v=vs.110%29.aspx[^].

—SA
 
Share this answer
 
v2
Comments
Member 10587318 28-Feb-14 0:11am    
Thank you for the reply.i need a program which can get ip address of a site after placing website address in address bar of a browser.It is my project concern and i need the program.please help me,please place any program as i don't have a deep knowledge in .net I'll be so grateful to you please provide a program,i'll be so grateful to you.
Sergey Alexandrovich Kryukov 28-Feb-14 0:17am    
Please see my update to the answer, after [EDIT].
—SA
Member 10587318 28-Feb-14 0:22am    
thank you,i don't have a knowledge in .net
Ok i'm sending my project details.this is my project on MitM

the program detects the attack by running as background application.It works on the main demerit in man-in-the middle(link below)

http://hacktobefree.blogspot.in/2013/10/detecting-man-in-middle-and-sniffers-in.html

while in attack the cmd prompt shows the attacker ip,instead of server ip.But only advanced users can do it after some keen watch in SSL failure.so i will design application which can differentiate client IP and server IP. and if client ip is detected in network instead of server ip it sends the info to admin about the Intruder IP.
You have a problem. You cannot just ping any web address you want. A lot of sites that used to respond to ping no longer do because of attacks that have been launched against them.

You can try to ping a site, but the result cannot be trusted. There i no way for you to know if the site is actually responding using ping.

On top of that, web servers do not respond to pings. The network stack on the web server does and ICMP ping messages only go up to Layer 3 of the network stack. It never makes it any higher (to the web server) so you can't possibly know if the web server responding of not.

So, what use is the information??
 
Share this answer
 
Comments
Member 10587318 28-Feb-14 0:08am    
Thank you for the reply and also for educating me.I don't know about this actually.but i need a program which can get ip address of a site after placing website address in address bar of a browser.It is my project concern and i need the program and i dont know have a deep knowledge in .net.please help me
Dave Kreskowiak 28-Feb-14 9:54am    
You next problem is that IE is the only browser that exposes a COM interface to get at the address typed into the address bar. This will not work with other browsers!

You have another problem. There is no event that says "the user is typing an address", so you have no idea that the user typed anything let alone that he typed a valid address.

There is nothing here that is of any use to anyone. If you wanted a list of IP addresses for a site, you'd use NSLOOKUP on Windows to do it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900