ASP Column 属性
完整的 TextStream 对象参考手册
Column 属性返回输入流中当前字符位置的列号。
注意:该属性在新行字符(new line character)被写入之后为 1 (在其他字符被写入前)。
语法
TextStreamObject.Column
实例
<%
dim fs,f,t,x,y
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)
do while t.AtEndOfStream<>true
x=t.Read(1)
y=t.Column-1
loop
t.close
Response.Write("The last character in the text file is: " & x)
Response.Write("<br> at character position: " & y)
%>
输出:
The last character in the text file is: !
at character position: 12
dim fs,f,t,x,y
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)
do while t.AtEndOfStream<>true
x=t.Read(1)
y=t.Column-1
loop
t.close
Response.Write("The last character in the text file is: " & x)
Response.Write("<br> at character position: " & y)
%>
输出:
The last character in the text file is: !
at character position: 12
完整的 TextStream 对象参考手册