Home | Advertising Info165 USERS CURRENTLY ONLINE   
   Site Search Contact Us Monday, October 24, 2016  

User Management Application with web based screens that allow you to manage users.
Banner Rotation system. Advertisers can monitor online statistical reports via their web browsers.
ASP Photo Gallery
Upload an unlimited amount of albums. Set up categories.Image resizing thumbnail creation.
Classifieds system. Set up categories. Users can register themselves. Supports picture uploads.

Try a free httpZip trial now and compress for less!

We didn't realize
the site was so popular.

Other Stuff

vbscript active server pages ASP vbscript SQL database informix oracle SQL Server Perl CGI Delphi PHP source code code sample samples program CJWSoft ASPProtect ASPBanner ASPClassifieds

(Advanced)  (Components)  (Database)  (General)  (Vbscript)


Subject: Re: Need help with Text Files!
From: Pete
Date: 3/9/1999 7:57:45 AM


To do what you asking you would first have to create a new file, write you new line to that file and then write the oldfile to the botton of it. I assume that you would want to have the new file have the same name as the old one so I've shown how to rename them by copying the files back over. I don't use the FileSystemObject that much myself so this might not work first time, for instance you may have to reopen the newfile in append mode when copying the oldfile over to it, have a play around. I learnt all this info from the VBScript site at microsoft : http://msdn.microsoft.com/scripting/default.htm

Heres the code:

' To insert your new line at the top of a file
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, oldfile, newfile, renamefile
Set fso = CreateObject("Scripting.FileSystemObject")
Set newfile = fso.OpenTextFile("c:\newfile.txt", 1, ForWriting, True)
newfile.Write "You new 1st line of text"
Set oldfile = fso.OpentextFile("c:\oldfile.txt", ForReading, True)
newfile.Write oldfile.readall

' To over write the old file with the new file
fso.CopyFile "c:\newfile.txt", "c:\oldfile.txt"
fso.DeleteFile "c:\newfile.txt"


Previous Message


   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright 1998 - 2016 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages asp source code database MS SQL MS Access .mdb adovbs.inc cookies calendar codes sql commands scripts asp programming tutorials iis web server components CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspclassifieds.com, www.powerasp.com,www.cjwsoft.com,www.aspphotogallery.com,www.codewanker.com,www.aspprotect.com,www.aspbanner.com