locked
How I get mob. device name & mac addr. in asp. vb RRS feed

  • Question

  • User-582711651 posted

    Hi, 

    please suggest me!

    By using the following method,  I am getting the clients Desktop/Laptop systems name well, here my questions is ...

    i) using this method can I get mobile device (android, iphone) name too?

    ii) similar this can I get device Mac address? 

    My code:

        Public Shared Function DetermineCompName(ByVal IP As String) As String
            Dim myIP As IPAddress = IPAddress.Parse(IP)
            Dim GetIPHost As IPHostEntry = Dns.GetHostEntry(myIP)
            Dim compName As List(Of String) = GetIPHost.HostName.ToString().Split("."c).ToList()
            Return compName.First()
        End Function

    Thanks in advance

    Saturday, September 12, 2020 9:08 PM

Answers

  • User475983607 posted

    It's not possible to get the MAC address and Name from a web application.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 13, 2020 11:43 AM

All replies

  • User475983607 posted

    It's not possible to get the MAC address and Name from a web application.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Sunday, September 13, 2020 11:43 AM
  • User1535942433 posted

    Hi ayyappan.CNN,

    i) using this method can I get mobile device (android, iphone) name too?

    You could check Request.Browser property for device/user agent. 

    More details,you could refer to below article:

    https://forums.asp.net/t/1601335.aspx?How+to+get+the+Mobile+Device+Name+in+VB+NET

    ii) similar this can I get device Mac address? 

    You won't be able to get the client's MAC address as that information isn't provided over the http protocol.

    More details,you could refer to below article:

    https://forums.asp.net/t/1911211.aspx?Get+Client+Mac+Address+in+Asp+Net+Web+Application

    Best regards,

    Yijing Sun

    Monday, September 14, 2020 2:26 AM
  • User-582711651 posted

    I tried this is working and get computer name locally, but I am getting error in client side (remote System), anything need to change?

    ref my code: 

    Public Shared Function DetermineCompName(ByVal IP As String) As String Dim myIP As IPAddress = IPAddress.Parse(IP) Dim GetIPHost As IPHostEntry = Dns.GetHostEntry(myIP) Dim compName As List(Of String) = GetIPHost.HostName.ToString().Split("."c).ToList() Return compName.First() End Function

    Please help me. 

    Monday, September 14, 2020 5:04 PM
  • User475983607 posted

    ayyappan.CNN

    I tried this is working and get computer name locally, but I am getting error in client side (remote System), anything need to change?

    For the second time!  A web server cannot get the MAC address and computer name.  If you want the web server to have this information then you must write a application installed on the client that sends the data to the web server.  Keep mind, even if the web server has this information it cannot be used for anything of importance.  The web server typically cannot contact the client using this information.  Usually there is nothing on the client listening unless your wrote an application.

    If this is not a web application then you are in the wrong forum.  Can you explain what problem you are trying to solve and how this information solve the problem?  

    Monday, September 14, 2020 5:22 PM
  • User-582711651 posted

    Hi, 

    Sorry, I am very beginner of this, yes I understand your point, im developing web an application, I'm trying to catch any one evedience from client machine who supplying or posting the data. This is my expectation. 

    Thanks.

    Tuesday, September 15, 2020 3:36 AM
  • User475983607 posted

    Sorry, I am very beginner of this, yes I understand your point, im developing web an application, I'm trying to catch any one evedience from client machine who supplying or posting the data. This is my expectation. 

    There's no way to uniquely identify a device over HTTP.  You can get the remote IP address but the IP address may not be unique or reliable. Typically the user is identified by login.

    Tuesday, September 15, 2020 10:41 AM
  • User-582711651 posted

    Hi, 

    Thanks for your reply, we are trying to prevent, users accessing the applications through their own gadgets, anyway I try to find out other ways or VPN methods. 

    Thanks

    Tuesday, September 15, 2020 12:09 PM