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
%>
若首次档案读出没字时....可能将显示出错误讯息
可在读文件中先设附注数据, 所以每个被读的檔
都有个本站资料
|