Home | Advertising Info132 USERS CURRENTLY ONLINE   
   Site Search Contact Us Wednesday, April 25, 2018  

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.


We didn't realize
the site was so popular.

Other Stuff

Active Server Pages ASP ASP.NET .aspx .ascx Web HTML Developer Internet Microsoft Web Services Visual Studio .NET CJWSoft ASPProtect ASPBanner ASPClassifieds

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


Subject: Re: Need help with writing Text Files!
From: Pete
Date: 3/9/1999 7:46:44 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 - 2018 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 search engine active server page asp application components tutorial 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