RSS

Code Snippet: How to get client machine name?

15 Apr

I had a requirement to get client’s machine name   using smartpart user control in sharepoint . i have tried number of methods but unfortunately those show server name only.

here  is the code which works fine.

Dim host As  System.Net.IPHostEntry

host = System.Net.Dns.GetHostEntry(Request.ServerVariables.Item(“REMOTE_HOST”)) 

Dim strComputerName As String = host.HostName

label1.text= strComputerName

Advertisements
 
1 Comment

Posted by on April 15, 2009 in ASP.NET, Code Snippets, Tips & Tricks

 

Tags: , ,

One response to “Code Snippet: How to get client machine name?

  1. Jim Parker

    May 4, 2009 at 6:33 PM

    Hi Jim: Cool tip, thanks for sharing!

    How can I incorporate this code into a CEWP that simply displays the computer name retrieved using your code?

    Thanks

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: