|
-
Jun 25th, 2001, 11:30 AM
#1
Thread Starter
Addicted Member
Two questions: File I/O and Printing from ASP???
Question 1:
How do I read a file into an ASP variable so that I can output certain sections of it to a web page? (I am familiar with doing this in VB/VBS but not ASP)
Question 2:
When I create "Printable version" of a web page is it possible to insert page breaks so that the page will stop at the end of a paragraph and continue printing the next paragraph on another page. I can create the "Printer friendly version" just fine but I don't like the way it breaks up the content of the page when begins printing the next page (pg. 2, pg. 3, etc). In short, I would like to control where one page ends and the next begins.
Thanks!
-
Jun 25th, 2001, 02:26 PM
#2
Lively Member
Answer 1:
Code:
Dim filesys, txtfile, line
set filesys = Server.CreateObject("Scripting.FileSystemObject")
set txtfile = filesys.OpenTextFile("c:\mytextfile.txt",1,0)
Do
line = txtfile.ReadLine
Loop Until txtfile.AtEndOfStream
txtfile.Close
Answer 2:
I have no idea...
-
Jun 25th, 2001, 03:00 PM
#3
Thread Starter
Addicted Member
What is the 1,0 for?
set txtfile = filesys.OpenTextFile("c:\mytextfile.txt",1,0)
Thanks
-
Jun 25th, 2001, 03:16 PM
#4
Lively Member
1 = To read from the file (could also be 8... append to the file)
0 = Open it as ASCII (could also be 1 (Unicode) or 2 (system standard)
-
Jun 26th, 2001, 06:32 AM
#5
Black Cat
Q2. I believe controlling how a page will print has been added to CSS. Although it's probably currently supported with IE 5.5.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Jun 26th, 2001, 10:57 AM
#6
Thread Starter
Addicted Member
CSS???
I have heard several people say that web developers should stay away from CSS (they actually mentioned another method to use but I can't remember it right now). What do you think about that, should I try to find an alternative or will CSS solve my problem (for all browsers). I currently use it to solve this same issue but I was hopeing for a different alternative.
Thanks!
-
Jun 26th, 2001, 12:24 PM
#7
Black Cat
CSS is an official web standard. Browsers will eventually fully comply with it. I think it's the only way to format for printing, and it deliberately has the features added because there was a need for this.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|