Solved

Client Hostname in vb.net

Posted on 2009-07-15
2
460 Views
Last Modified: 2013-11-26
I am trying to determine the hostname of the client accessing the webpage. If the user is coming from a .edu let them see the button. If not, don't let them see the button.  After searching some groups this is what I have, but I can't get it to work.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        
 
 

	Public Function IPToHostName(ByVal IPAddress As String) _

          As String
 

        Dim objEntry As IPHostEntry

        Dim sAns As String

        Try

            objEntry = Resolve(IPAddress)

            sAns = objEntry.HostName

        Catch ex As Exception
 

            sAns = ""

        End Try
 

        Return sAns
 

    End Function
 

	Response.Write (sAns)
 

    End Sub
 

End Class

Open in new window

0
Comment
Question by:j1haskins
2 Comments
 
LVL 33

Accepted Solution

by:
raterus earned 500 total points
ID: 24859410
Even if you got this working, I don't think you are going to be happy with it.  In order to do this, you'll have to do a reverse lookup on their IP address.  The ISP owns that ip address, and they are going to have to be nice enough to have entered a nice .edu domain there.  There is no guarantee that is done, and I imagine for the most part it isn't setup properly.
0
 

Author Closing Comment

by:j1haskins
ID: 31603647
Thank you for your assistance.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

747 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

9 Experts available now in Live!

Get 1:1 Help Now