ASP OpenAsTextStream နည်းလမ်း
❮ ဖိုင် Object ရည်ညွှန်းချက်ကို အပြီးသတ်ပါ။
OpenAsTextStream နည်းလမ်းသည် သတ်မှတ်ထားသောဖိုင်ကိုဖွင့်ပြီး ဖိုင်ကိုဝင်ရောက်ရန် TextStream အရာဝတ္ထုကို ပြန်ပေးသည်။
အထားအသို
FileObject.OpenAsTextStream(mode,format)
Parameter | Description |
---|---|
mode | Optional. How to open the file.
|
format | Optional. The format of the file.
|
ဥပမာ
<%
dim fs,f,ts
set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.GetFile("c:\test.txt")
Set ts=f.OpenAsTextStream(ForWriting)
ts.Write("Hello World!")
ts.Close
Set ts=f.OpenAsTextStream(ForReading)
Response.Write(ts.ReadAll)
ts.Close
set ts=nothing
set f=nothing
set fs=nothing
%>
Output:
Hello World!
❮ ဖိုင် Object ရည်ညွှန်းချက်ကို အပြီးသတ်ပါ။