get read obtain ip mac address name user pc name using vb 2008 and asp

these is the code for obtain ip, mac address, name pc, and user in a client side:

Imports System.Net.NetworkInformation
Partial Public Class _Default
    Inherits System.Web.UI.Page
    Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, ByRef nsize As Integer) As Integer
    Public Function GetUserName() As String
        Dim iRturn As Integer
        Dim username As String
        username = New String(CChar(" "), 50)
        iRturn = GetUserName(username, 50)
        GetUserName = username.Substring(0, username.IndexOf(Chr(0)))
    End Function
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim fecha As Date = Today
        Dim NameHost As String = System.Net.Dns.GetHostName
        Dim InfoHost As System.Net.IPHostEntry = System.Net.Dns.GetHostEntry(NameHost)
        Dim networkcard() As NetworkInterface = NetworkInterface.GetAllNetworkInterfaces()
        Dim netcard As String = networkcard(0).GetPhysicalAddress.ToString()
        'obtiene el nombre de la computadora
        lblusuario.Text = "El nombre de su Computador es:  " & InfoHost.HostName.ToString
        'buscar el ip por medio del nombre de la comptadora
        For Each ip As System.Net.IPAddress In InfoHost.AddressList
            lblip.Text += "    y su IP es: " & ip.ToString
        'imprime la fecha actual del cliente
        lblfecha.Text = fecha
        'imprime el nombre del usuario que esta usando esta aplicacion (usuario de windows)
        lblusername.Text = GetUserName
        'imprime la MAC ADDRESS del computador
        lblmac.Text = netcard
    End Sub
End Class



these code is very easy to read..



yes i want share the code for everybode, and if you want change, do it... i want learn about asp .NET, and you can help..



8/21/2008 12:38:11 AM 91979 articles. 3 followers. Follow

3 Replies

Similar Articles

[PageSpeed] 33

Maybe the code you posted works if: client = server

And your question is.....?

9/2/2008 11:53:32 PM

Maybe he wants to share his code with everybody.. No bad idea....

"Mark As Answer" If my reply helped you --
9/3/2008 2:36:12 AM

 yes, i want improve this code, any idea..

9/3/2008 2:00:31 PM

Similar Artilces:

How to get user name or user ip address?
Hi to all! I have written a little survey application for our intranet. In order to prevent users from taking the survey a second (3rd, 4th, 5th...) time, the app should detect the user name, or the ip address of the session. Does someone know how to manage this with WebMatrix? Thanks! Bye, MichaelTo finish first, you first have to finish. Sure, you can use the Request object. Request.UserHostAddressStanley Tan theSpoke Blog Stanley, thanks! I searched the MSDN library. I found this article

How to get Hostname, IP address, port number, DB name, instance name using Query
As we know, normally we connect to a sybase server by just identifying the node name and interfaces file and necessary properties, but currently I want to get Host-name, IP address, port number, DB name, instance name of connected server out after connection created. Does any one how to use query to do so? Does sybase provide such functionality? Seems oracle can do so... If there is no query, does sybase provides any API which can implement this? Thanks! instance name: select @@servername [assumes the DBA has defined a local entry in syservers] db name: select db_name() [can...

How to get windows log-in user name using code?
Hi, I built an web application on our companies HR system so that recruitors can post jobs. Is there a way to get the windows logged in user name using code? This user name is using for tracking who posted the job. Thank you.   Windows Authentication provides some options, as does forms authentication.  See if you get what you need through User.Identity.Name.  Take a look at: JeffPlease: Don't forget to click "Mark as Answer" on the p...

Is it possible to get user name from active directory using IP address?
 Is it possible to get user name from active directory using IP address in .NET 2.0 code? So with the IP, you can find out the user name, then you know which user login using  the specific PC.A piece of demo code please.   Don't think that it is a good approach. If your application relies on windows authentication then you can get the domain user  Account by using this.User.Identity.Namewhere this is the instance of the page Jeev~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~If you get the answer to your question, please mark it as the answer. Using this.User.Identi...

How to get the user name of a process in
Could anybody tell meHow to get the user/owner name of a process in reason I need it is because I developed an application,which I will put on the winnt enviroment, I want to allow multiple instance.but only allow one single instance per user.I am using Application.Run(MyMainForm) to start my applicationThanks,Joseph...

Is there a way to get IP/Host name given the MAC address?
------_=_NextPart_001_01C19DA2.7BFEE650 Content-Type: text/plain; charset="Windows-1255" > Hi, > > Does anybody know's a way to get a Host name > If I have a Mac address both in pc and sun? > (it's the same as RARP but I don't know how to do it using command line ) > > THX > > ------_=_NextPart_001_01C19DA2.7BFEE650-- 1. SUN without DNS: arp -a 2. SUN with DNS: arp -a; nslookup hostname For Example: % arp -a | grep '00:55:' Net to Media Table Device IP Address Mask Flags...

How to get domain user's first name, last name and e-mail address
Hi everyone, I am able to retrieve the domain/user ID by setting <authentication mode="Windows"/> in the Web.config file, and with the following code in my Default.aspx.,cs page: string strName = Request.ServerVariables["AUTH_USER"]; I would also like to retrieve the users first name, last name and e-mail address from their domain profile, if possible.  Can anyone help me with a code example?  I'm somewhat new to C#/.NET/OOP so if you have it in "C# for Dummies" format, I would be very thankful! Thanks in advance for any help that i...

Can not get user name from HttpContext.Current.User.Identity.Name
Hi All; I have tried to use HttpContext.Current.User.Identity.Name to get window user account. However, from debugger, for a long time ago I saw my window user name. But now, I did not see my window user name (from debugger) with the same code and same function call. Please help. Was I doing something wrong? Or any special settings on web.config/machine.config or project to make it work??? I'm stuck Thanks a lot well, you have to have windows integrated authentiction enabled in IIS, IIRC.RTFM - straight talk for web developers. Unmoderated, uncensored, occasionally unre...

Getting User My.User.Name to use in text box
Hi All,I have a page load event on my opening web page Default.aspx that includes the following code: SearchString = My.User.Name.ToString()when I run the code on my localhost it tells me that SearchString is (lets say) mashfield, my logged on user name.  However, when I i run it on our web server, searchstring returns blank.can anybody explain this?CheersMatt Matt A This means your request is not authenticated. User.Identity.Name is expected to be an empty string if the request is anonymous.If might want to disable the Anonymous access in InetMgr, at the application level. If Window...

How Do I get rid of \\ ( ie\\ipp//:ip address/ipp/printer) out of the start of my printer name
Hi, How Do I get rid of \\ out of the start of my printer name, I think this is stopping me printing to some printers with certain drivers(HP driver don't seem to mind). If I set printers up manual I do not have this problem and the driver works with the printer, but if I use the automated iprint way it adds \\ to the start of the printer name and it hangs my spooler file. Michael, It appears that in the past few days you have not received a response to your posting. That concerns us, and has triggered this automated reply. Has your problem been resolved? If not, you might ...

Problem in getting logged in user Name for ASPX page with (even with this.User.Identity.Name)
Hi  friends,  I am creating an application that takes current logged in user and displays on the page itself. for this I am getting the user name in PageLoad function by using this.User.Identity.Name and then storing the value in a hidden variable for aspx page. I am using this hidden  variable to display the name of the user. I am using Windows authentication for this. Now problem that I am getting is that when multiple user launch the application from different machine and if they click simultaneously, name of one user appears on the paged displayed on the machine of ot...

Getting the MAC Address, ISP IP, Client IP of the user and verifying it to let the Login
Hi Everyone,Any help for getting the IP address of the client, its MAC address and its ISP IP so that after checking these he will be let into login.RegardsSadeed Remember to click “Mark as Answer” on the post If you get answer from this post(s) !Thanks GuysRegardsSid  Is this over the LAN or over the internet?Over the internet, you can only get the apparent IP address of the user (which may be the address of the external router).As to getting the IP of the ISP, then closest might be do a traceroute and take the last but IP address. Don't forget to click "Mark as Answer"...

Get host name from IP address
does anyone have any simple C# code that can do this?pwpaust Try this.  It's a simple page that looks up both IP and name.  I've put in some data to test with, but you can enter your own text!   <%@ Page Language="C#" %> <%@ Import Namespace="System.Net" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ""> <script runat="server"> protected string DNSLookup(string domain) { string result = string.Empty; try { IPHostEntry ipHe = Dns.GetHostEntry(domain); IPAddress[] ipAd...

Get domain name from IP address
 Hi all,          I want to convert an Ip address to corresponding domain name if any. Do i really need to use some third party components like IP2location .. Guys Please help..   thanks in advanceplease click 'Mark as Answer' if my post helped you. HostName = System.Net.Dns.GetHostName(); IPAddres = System.Net.Dns.GetHostAddresses(HostName).GetValue(0).ToString();Thanks,AdamPlease "Mark as Answer" if this has helped you.  The above link is ...

How to get IP address/name of the machine
Hi all, I have a requirement to find out IP address/name of the machine to which a given windows user is currently logged on. Is that possible with C#? If anyone has came across sample code please guide me to appropriate resource. Blog: SEO Articles Website: Search Engine Ranking Are you looking for this? Request.UserHostAddress()   Jef Claes~~~~~~~~~~Visit my blog Hi, Please try to use my code: public static string IPAddress { get { string userIP; HttpRequest Request = HttpContext....

Web resources about - get read obtain ip mac address name user pc name using vb 2008 and asp -

File:Ipv6 address.svg - Wikipedia, the free encyclopedia
I, the copyright holder of this work, release this work into the public domain . This applies worldwide. This file contains additional information, ...

Civil Defence continues to tackle blaze at The Address Downtown Dubai - The National
A lower part of the hotel building was still on fire at 8am Friday, a resident and a photographer from The National said.

Dubai fire at Address Downtown: Photographer’s narrow escape
A PHOTOGRAPHER has told of a harrowing 30 minutes he spent trapped on a ledge metres from the raging inferno that engulfed a skyscraper in Dubai ...

Dubai hotel fire: At least 16 injured as officials probe cause of blaze at The Address Downtown hotel ...
Investigators in Dubai are working to determine the cause of a fire that engulfed a 63-storey luxury hotel on New Year's Eve.

Apple just registered the 'Apple.Car' web address
Apple has purchased a bunch of web addresses related to cars, including and, according to registration records spotted by ...

President Obama previews his final State of the Union address
The president is scheduled to deliver his final address next Tuesday to both chambers of Congress

Cameron pledges to address roots of UK Islamist extremism in 2016
... plan of social reform to be built on the country's recovering economic foundations. Prime Minister David Cameron pledged on Friday to address ...

Fire at downtown Dubai's highrise Address hotel
CNN Fire at downtown Dubai's highrise Address hotel CNN (CNN) A massive fire broke out Thursday night at the high-end Address hotel in downtown ...

'Grey's Anatomy' Stars Address Series' Future: 'This Show Is a Vampire, It Can't Be Killed'
'Grey's Anatomy' Stars Address Series' Future: 'This Show Is a Vampire, It Can't Be Killed'

Pathankot attack: Time for PM Modi to dump NRIs, address nation on language of India-Pak dialogue
I believe that for the Narendra Modi government, we NRIs have become a cop-out of the first order. We have been singularly responsible for having ...

Resources last updated: 1/9/2016 11:19:42 AM