web tools rank checker

domain .cn
.net .cn .com.cn
你正在阅览 :: 简体中文:: 学习 ASP SQL VB HTML code

学习 .ASP SQL HTML XML CSS JAVA Perl code study
English Chinese_Traditional Chinese_Simplified

你正在阅览 :: 简体中文 Chinese_Simplified

学习.主题:
首页
ASP
. Active-Server-Flash
. Array
. Connection
. Count
. Counter
. Distinct
. Email
. File
»Create
»delete
»File-obj-Count
»Move
»ReadAll-ReadLine
»Server.MapPath
. Folder
. Function
. GetSQLserver
. Header
. mySQL
. Record
. Recordset
. Request
. Response
. Server
. Server-CreateObject
. ServerVariables
. Session
. Special-Symbols
. String
. Sub
. Time
CSS
Ecommerce
HTML
InternetProtocol
JAVA
Microsoft
Robots
SearchEngine
SQL
SQLserver
VBscript
XML

SiteMap

3w....学习.教学 > ASP > file » readall-readline

3w learning

file >
readall-readline

Title:

read and print server side file code


自己由浏览器读取自己伺服端的档案原始码
Description:

Set fso = Server.CreateObject ("Scripting.FileSystemObject") or Set fso = CreateObject ("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(thePath) .Readline .Readall


Example Code:

***** this is a file show example ******* <% '***** this is a file show code start ******* thePath="c:\mypath\a-File.asp" Set fso = Server.CreateObject ("Scripting.FileSystemObject") Set ts = fso.OpenTextFile(thePath) fileShow = ts.Readline ' only read a line fileShow = ts.Readall 'read all file ts.close Set ts=nothing Set fso=nothing response.write "*** EZER.com code show example ***<br>" '-------- do not show VB but only Text by <pre>----------- response.write("<pre>" & fileShow & "</pre>") '-------- no VB code but only Text ------- response.write Server.HTMLencode(fileShow) '------- show VB <% %> code by <pre> ------ response.write("<pre>" & Server.HTMLencode(fileShow) & "</pre>") '------- show VB <% %> code by <pre> ------ response.write "<pre>" & replace(fileShow,"<","& lt;") &"</pre>" response.end %>


若首次档案读出没字时....可能将显示出错误讯息

可在读文件中先设附注数据, 所以每个被读的檔
都有个本站资料
Example Result:


------ attention for often error appears -------- Microsoft VBScript runtime error ' 800a003e ' Input past end of file Ezer solutation : Try to add something in the text file for it to work or to show. may because: without htmlencode or replace function the VB code can not be show when nothing to show the error will appear..... Example : to add ***START OF FILE*** Author: Ezer **** ***END OF FILE*** or something remark text


..
...
...

[ 7/27/2008 ]

www learning school add more scripts and tips memo
You are at >>3WS.EZER.COM >> 3WS.EZER.COM/ASP/FILE/READALL-READLINE.ASP>>ASP
Helpful link:: SEO web tools :: Live PR | SERP checker
back to top Ezer code adding :: Questions ;email