Is it possible to capture the users hostname or something when an app is loaded and have that information sent to a text file sitting on a domain, is this possible?
Thank you.
Printable View
Is it possible to capture the users hostname or something when an app is loaded and have that information sent to a text file sitting on a domain, is this possible?
Thank you.
Do you mean the one returned by the gethostname function?
Quote:
The gethostname function retrieves the standard host name for the local computer.
Yes, how do I implement that into vb6 and write the info to a file ?
Code:Private Declare Function gethostname Lib "ws2_32.dll" (ByVal Name As String, ByVal NameLen As Long) As Long
Private Function GetNameOfHost() As String
Dim sBuffer As String * 256
If gethostname(sBuffer, 256&) = 0& Then
GetNameOfHost = LeftB$(sBuffer, InStrB(sBuffer, vbNullChar))
End If
End Function
Private Sub Form_Load()
Open strDomainPath For Output As #1
Print #1, GetNameOfHost
Close #1
End Sub