ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Looking for ASP/VBscript function writing to file

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
spas



Joined: 12 Oct 2004
Posts: 3

PostPosted: Wed Nov 03, 2004 5:17 pm    Post subject: Looking for ASP/VBscript function writing to file Reply with quote

Hi,

I'm trying to write to a text file from ASP page, but no success so far Sad.
Can anybody give me a ready ASP/VBScript function that writes to a file?
I want to pass the file name/location as parameter to this function.


Thanks in advance,

Spas
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Wed Nov 03, 2004 11:24 pm    Post subject: Reply with quote

I have ready-made VBScript function writing to a text file and I'll post it here tomorrow Smile
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Thu Nov 04, 2004 9:25 am    Post subject: Reply with quote

Here is the ASP/VBscript function that writes to a file:


Code:

Sub WriteFile(ByVal sContent, ByVal sFilePath)
   
   Dim oFSO, oTF

   Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
   Set oTF = oFSO.OpenTextFile(sFilePath, 2, True)
   oTF.Write(sContent)
   oTF.Close
   Set oTF = Nothing
   Set oFSO = Nothing

End Sub


_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial