Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2004, 05:08 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 141
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to acdsky
Default FSO Logfile Problem

Hi

I have got a login page that will redirect users depending on their group member ship. I also got a logging part that will record the login onto a txt file using FSO. Below my code:

Set oNetwork = CreateObject("WScript.Network")
sUserName = oNetwork.UserName
sDomain = "myservername"
Set oUser = GetObject("WinNT://" & sDomain & "/" & sUserName & ",user")
CreateObject("Scripting.FileSystemObject").OpenTex tFile("c:\log.txt", 8, True).Write (oUser.Fullname) & " ~ " & (date()) & " ~ " & (time()) & vbCrLf

My problem is that it is not writing every single login into the file? Might it be that Im not setting something = nothing after every loging?

Any advice appreciated.

Regards
Marnus
 
Old April 10th, 2004, 01:57 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

May be you can set the objects to nothing at the end after writing the details on log file. But it seems to work fine. I dont see any problem in it. May be you can explain when/where this part of the code is executed in your scenario.

Cheers!

-Vijay G
 
Old April 11th, 2004, 10:27 PM
Authorized User
 
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Mohammed
Default

Do u have right privilege to process files?

if u got correct settings on privilege then try the statements below:

set fso=CreateObject("Scripting.FileSystemObject")
set f=fso.OpenTextFile("c:\log.txt", 8, True)
f.writeline(oUser.Fullname & " ~ " & (date()) & " ~ " & (time()) & vbCrLf)
f.close
set fso=nothing


hopes to help.


No Pains,No Gains.:D





Similar Threads
Thread Thread Starter Forum Replies Last Post
create server side logfile from javascript senthilkumar Javascript 1 March 22nd, 2006 02:50 PM
Problem with Sharename property using FSO pb_user Classic ASP Basics 2 September 2nd, 2004 10:27 AM
FSO mikedeepak Classic ASP Databases 0 August 4th, 2004 12:35 AM
Need Help Building a Logfile erehdogmai Excel VBA 1 May 5th, 2004 10:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.