Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. 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 Professional 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 February 1st, 2005, 03:17 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Help Plz

dim f2
'dim ts
Set f2 = fso.GetFile("w:\boseo\" & strFile)
Set ts = f2.OpenAsTextStream(1,-2)

do while ts.AtEndOfStream = False
    Response.Write ts.ReadLine & "<BR>"

'(how can i collect the vaues from the file and put them in the right order? How can i create a variable to store all the data in and then i can just call that variable later?)

loop
--------------------------------
how can i collect the vaues from the file and put them in the right order?

How can i create a variable to store all the data in and then i can just call that variable later?

 
Old February 1st, 2005, 03:40 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Please check the following function which reads all contents from a file:

Function ReadAllTextFile
   Const ForReading = 1, ForWriting = 2
   Dim fso, f
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set f = fso.OpenTextFile("c:\testfile.txt", ForWriting, True)
   f.Write "Hello world!"
   Set f = fso.OpenTextFile("c:\testfile.txt", ForReading)
   ReadAllTextFile = f.ReadAll
End Function

To read line by line you can use

 Do While theFile.AtEndOfStream = false
       retstring = theFile.ReadLine 'This will give u single line.
 Loop



Om Prakash




Similar Threads
Thread Thread Starter Forum Replies Last Post
plz.....plz solve out my problem.... kethireddy435 ASP.NET 1.x and 2.0 Application Design 1 October 4th, 2007 12:56 PM
image varification problem in asp.net1.1 plz help nirmalbarsainyan ASP.NET 1.x and 2.0 Application Design 0 November 15th, 2006 12:54 AM
Ms access database in asp-urgent plz netfresher Classic ASP Basics 1 June 30th, 2006 03:35 PM
Help me plz waqaraziz VB.NET 2002/2003 Basics 1 March 19th, 2005 04:40 PM
I'm a bignner to ASP.NET, plz help me salman .NET Web Services 1 January 7th, 2004 05:24 PM





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