|
-
Jan 16th, 2013, 08:13 AM
#1
Thread Starter
Hyperactive Member
Req" Capturing Info help please
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.
-
Jan 16th, 2013, 08:47 AM
#2
Re: Req" Capturing Info help please
Do you mean the one returned by the gethostname function?
The gethostname function retrieves the standard host name for the local computer.
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
-
Jan 16th, 2013, 09:06 AM
#3
Thread Starter
Hyperactive Member
Re: Req" Capturing Info help please
Yes, how do I implement that into vb6 and write the info to a file ?
-
Jan 16th, 2013, 09:22 AM
#4
Re: Req" Capturing Info help please
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
On Local Error Resume Next: If Not Empty Is Nothing Then Do While Null: ReDim i(True To False) As Currency: Loop: Else Debug.Assert CCur(CLng(CInt(CBool(False Imp True Xor False Eqv True)))): Stop: On Local Error GoTo 0
Declare Sub CrashVB Lib "msvbvm60" (Optional DontPassMe As Any)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|