ASP TextStream অবজেক্ট

The TextStream object is used to access the content of the text file.

ইনস্ট্যান্স

ফাইল পড়া
এই উদাহরণ দেখায় কিভাবে FileSystemObject-এর OpenTextFile মথড ব্যবহার করে একটি TextStream অবজেক্ট তৈরি করা যায়।TextStream অবজেক্টের ReadAll মথড খোলা টেক্সট ফাইল থেকে সমস্ত সামগ্রী পাওয়া যায়
টেক্সট ফাইলের একটি অংশ পড়া
এই উদাহরণ দেখায় কিভাবে একটি টেক্সট স্ট্রিম ফাইলের একটি অংশকে শুধুমাত্র পড়া যায়
টেক্সট ফাইলের একটি লাইন পড়া
এই উদাহরণ দেখায় কিভাবে একটি টেক্সট স্ট্রিম ফাইল থেকে একটি লাইন পড়া যায়
টেক্সট ফাইলের সমস্ত লাইন পড়া
এই উদাহরণ দেখায় কিভাবে টেক্সট স্ট্রিম ফাইল থেকে সমস্ত লাইন পড়া যায়
টেক্সট ফাইলের একটি অংশ পাস করা
এই উদাহরণ দেখায় কিভাবে টেক্সট স্ট্রিম ফাইল পড়ার সময় নির্দিষ্ট অক্ষর সংখ্যা সাইন করা যায়
টেক্সট ফাইলের একটি লাইন পাস করা
This example demonstrates how to skip a line when reading a text stream file.
Return line number
This example demonstrates how to return the current line number in the text stream file.
Get column number
This example demonstrates how to get the column number of the current character in the file.

TextStream object

The TextStream object is used to access the content of the text file.

The following code will create a text file (c:\test.txt) and then write some text to this file (variable f is an instance of a TextStream object):

<% 
dim fs, f 
set fs=Server.CreateObject("Scripting.FileSystemObject") 
set f=fs.CreateTextFile("c:\test.txt",true) 
f.WriteLine("Hello World!")
f.Close
set f=nothing
set fs=nothing
%>

To create an instance of a TextStream object, we can use the FileSystemObject's CreateTextFile method or OpenTextFile method, or we can use the File object's OpenAsTextStream method.

The properties and methods of the TextStream object are described as follows:

Property

Property Description
AtEndOfLine In the TextStream file, if the file pointer is exactly in front of the end-of-line marker, then this property returns True; otherwise, it returns False.
AtEndOfStream If the file pointer is at the end of the TextStream file, this property returns True; otherwise, it returns False.
Column Return the column number of the current character position in the TextStream file.
Line Return the current line number in the TextStream file.

Method

Method Description
Close একটি খুলা TextStream ফাইলকে বন্ধ করুন。
Read একটি TextStream ফাইল থেকে নির্দিষ্ট সংখ্যক অক্ষর পড়ুন এবং ফলাফল (শব্দসূচক) রিটার্ন করুন。
ReadAll একটি TextStream ফাইলকে সম্পূর্ণভাবে পড়ুন এবং ফলাফল রিটার্ন করুন。
ReadLine একটি TextStream ফাইল থেকে একটি সারি পড়ুন (সাইন্যাপস পর্যন্ত এবং সাইন্যাপস নিচ্ছেন না) এবং ফলাফল রিটার্ন করুন。
Skip একটি TextStream ফাইল পড়ার সময় নির্দিষ্ট সংখ্যক অক্ষর সাইন্যাপস করুন。
SkipLine একটি TextStream ফাইল পড়ার সময় আগত একটি সারি সাইন্যাপস করুন。
Write 写一段指定的文本(字符串)到一个 TextStream 文件。
নির্দিষ্ট সংখ্যক টেক্সট (স্ট্রিং) স্ক্রিপ্ট ফাইলে লিখুন WriteLine
নির্দিষ্ট সংখ্যক টেক্সট (স্ট্রিং) এবং বিনম্র স্ক্রিপ্ট ফাইলে লিখুন WriteBlankLines