I'm trying to get this code working within an asp page. when the user clicks an OnClick button, it will take them to this page which will create a file to store that user's username and the time they executed the code. So far, when this code runs, it will create the "userinfo.flag" file but it does not capture the user's data. Basically, i'm not grabing the users data correctly.
<%
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set NewTextFile = FSO.OpenTextFile(server.mappath("UserInfo.flag"),2,true)
Set WshNetwork = WScript.CreateObject("WScript.Network")
WScript.Echo "User Name = " & WshNetwork.UserName
NewTextFile.WriteLine("user:")
NewTextFile.WriteLine(WshNetwork.userName)
NewTextFile.WriteLine(Now)
NewTextFile.Close
Set NewTextFile = Nothing
Set FSO = Nothing
%>
<HTML>
<HEAD>
<TITLE>TEST PAGE</TITLE>
</HEAD>
</HTML>