Results 1 to 4 of 4

Thread: Req" Capturing Info help please

  1. #1

    Thread Starter
    Hyperactive Member jokerfool's Avatar
    Join Date
    Dec 2006
    Location
    Gold Coast, Australia
    Posts
    452

    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.

  2. #2
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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)

  3. #3

    Thread Starter
    Hyperactive Member jokerfool's Avatar
    Join Date
    Dec 2006
    Location
    Gold Coast, Australia
    Posts
    452

    Re: Req" Capturing Info help please

    Yes, how do I implement that into vb6 and write the info to a file ?

  4. #4
    Default Member Bonnie West's Avatar
    Join Date
    Jun 2012
    Location
    InIDE
    Posts
    4,060

    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
  •  



Click Here to Expand Forum to Full Width