# Function to find a username by IP

**URL:** <https://forums.thehomestack.io/t/function-to-find-a-username-by-ip/155>\
**Category:** vb.Net\
**Created:** [March 16, 2004, 3:56am UTC](https://forums.thehomestack.io/t/function-to-find-a-username-by-ip/155 "2004-03-16T03:56:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![robinhood1995](https://forums.thehomestack.io/letter_avatar_proxy/v4/letter/r/48db29/32.png) [@robinhood1995](https://forums.thehomestack.io/u/robinhood1995)\
**Post date:** [March 16, 2004, 3:56am UTC](https://forums.thehomestack.io/t/function-to-find-a-username-by-ip/155/1 "2004-03-16T03:56:59Z")

</div>

Found [Here](http://vbcity.com)

```auto

Private Function NBTStatInfo(ByVal ip As String) As String 
        Dim p As Process 
        Dim cmd As String 
        Try 
            p = New Process 
            cmd = System.Environment.GetFolderPath(Environment.SpecialFolder.System) & "\cmd.exe" 
            p.StartInfo.FileName = cmd 
            p.StartInfo.Arguments = "/C nbtstat -A " & ip 
            p.StartInfo.RedirectStandardOutput = True 
            p.StartInfo.UseShellExecute = False 
            p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden 
            p.Start() 
            p.WaitForExit(1000) 
            Return p.StandardOutput.ReadToEnd 
        Catch ex As Exception 
            Debug.WriteLine(ex.ToString) 
            Return Nothing 
        Finally 
            If Not p Is Nothing Then 
                p.Dispose() 
                p = Nothing 
            End If 
        End Try 
    End Function 

```
