codecamp

ASP ReadAll 方法

ASP ReadAll 方法


TextStream 对象参考手册 完整的 TextStream 对象参考手册

ReadAll 方法可读取整个 TextStream 文件,并以字符串返回结果。

注意:此方法不适合大型文件(会浪费内存资源)。

语法

TextStreamObject.ReadAll

实例

<%
dim fs,f,t,x
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.CreateTextFile("c:\test.txt"")
f.write("Hello World!")
f.close

set t=fs.OpenTextFile("c:\test.txt"",1,false)
x=t.ReadAll
t.close
Response.Write("The text in the file is: " & x)
%>

输出:

The text in the file is: Hello World!


TextStream 对象参考手册 完整的 TextStream 对象参考手册
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

ASP 实例

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }