ASP TextStream.Column 属性
ASP Column 属性用于返回 TextStream 文件中当前字符位置的列号。它是一个只读属性。
注意:在写入字符之后(甚至在写入任何其他字符之前),此属性为 1。
句法:
TextStreamObject.Column
示例代码:下面的代码说明了 ASP 列属性
ASP
<%
dim gfg,f,t,x,y
set gfg=Server.CreateObject("Scripting.FileSystemObject")
set f=gfg.CreateTextFile("d:\GFG.txt") // creating a File
f.write("Hello GeeksForGeeks")
f.close
// opening a file
set t=gfg.OpenTextFile("d:\GFG.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("
at character position: " & y)
%>
输出:
The last character in the text file is: s
at character position: 19