CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Apr 2009

    Log Windows username from HTML file into txt file

    Hi, I have the following code on and html file, but i cant make it work,
    Any Ideas ??? Please help : )
    <script language="vbscript">
    function DoOnLoad()
    Declare Function GetSystemMetrics Lib "user32.dll" (ByVal nIndex As Long) As Long 
    On Error GoTo LogFail
        Dim filenum As Integer
        Dim i As Integer
        Dim fic As String
        filenum = FreeFile
        logfile = "C:\over.log"
        Open logfile For Append As filenum
        Print #filenum, Date & " " & Time & ";" & Environ("UserName") & ";" & Environ("ComputerName") & ";"
        Close filenum
    MsgBox "Errors has been detected.", vbExclamation, "Warning"
    end function
    <body onload="vbscript:DoOnLoad">
    Este archivo deberia logear en c:\over.log
    Last edited by Frlecube; April 27th, 2009 at 12:24 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.