ÄúµÄλÖãº
Ñ°ÃÎÍøÊ×Ò³
£¾
±à³ÌÀÖÔ°
£¾
VBScript
£¾
VBScript
objects
constants
operators
statements
functions
properties
methods
All Properties
TextStream Object
Property: TextStream.Column
object.
Column
Returns the current position of the file pointer within the current line. Column 1 is the first character in each line.
The follwing code uses the
Column
property to get the column number of the last character in a text file.
Code:
<%
dim filesys, text, readfile, contents
set filesys = CreateObject("Scripting.FileSystemObject")
Set text = filesys.CreateTextFile("c:\somefile2.txt")
text.Write "Find the last character in the text file"
text.close
set readfile = filesys.OpenTextFile("c:\somefile2.txt", 1, false)
do while readfile.AtEndOfStream <> true
contents = readfile.Read(1)
col = readfile.Column -1
loop
readfile.close
Response.Write "The last character in the text file is '" & contents & "' and it's_
column number is '" & col & "'."
%>
Output:
"The last character in the text file is 'e' and it's column number is '40'."