濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > filesystemobject組件的用法示例

filesystemobject組件的用法示例

熱門標(biāo)簽:修改地圖標(biāo)注 武夷山旅游地圖標(biāo)注 鳳臺(tái)百度地圖標(biāo)注店 外呼系統(tǒng)API接口 金昌電話機(jī)器人價(jià)格 萊西電子地圖標(biāo)注 個(gè)人可以辦理400電話么 怎么在地圖標(biāo)注自己 縣域地圖標(biāo)注打印店
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' CreateLyrics
' 目的:
' 在文件夾中創(chuàng)建兩個(gè)文本文件。
' 示范下面的內(nèi)容
' - FileSystemObject.CreateTextFile
' - TextStream.WriteLine
' - TextStream.Write
' - TextStream.WriteBlankLines
' - TextStream.Close
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Sub CreateLyrics(Folder)

Dim TextStream

Set TextStream = Folder.CreateTextFile("OctopusGarden.txt")

TextStream.Write("Octopus' Garden ") ' 請(qǐng)注意,該語(yǔ)句不添加換行到文件中。
TextStream.WriteLine("(by Ringo Starr)")
TextStream.WriteBlankLines(1)
TextStream.WriteLine("I'd like to be under the sea in an octopus' garden in the shade,")
TextStream.WriteLine("He'd let us in, knows where we've been -- in his octopus' garden in the shade.")
TextStream.WriteBlankLines(2)

TextStream.Close

Set TextStream = Folder.CreateTextFile("BathroomWindow.txt")
TextStream.WriteLine("She Came In Through The Bathroom Window (by Lennon/McCartney)")
TextStream.WriteLine("")
TextStream.WriteLine("She came in through the bathroom window protected by a silver spoon")
TextStream.WriteLine("But now she sucks her thumb and wanders by the banks of her own lagoon")
TextStream.WriteBlankLines(2)
TextStream.Close

End Sub

' GetLyrics
' 目的:
' 顯示 lyrics 文件的內(nèi)容。
' 示范下面的內(nèi)容
' - FileSystemObject.OpenTextFile
' - FileSystemObject.GetFile
' - TextStream.ReadAll
' - TextStream.Close
' - File.OpenAsTextStream
' - TextStream.AtEndOfStream
' - TextStream.ReadLine
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Function GetLyrics(FSO)

Dim TextStream
Dim S
Dim File

' 有多種方法可用來打開一個(gè)文本文件,和多種方法來從文件讀取數(shù)據(jù)。
' 這兒用了兩種方法來打開文件和讀取文件:

Set TextStream = FSO.OpenTextFile(TestFilePath "\Beatles\OctopusGarden.txt", OpenFileForReading)

S = TextStream.ReadAll NewLine NewLine
TextStream.Close

Set File = FSO.GetFile(TestFilePath "\Beatles\BathroomWindow.txt")
Set TextStream = File.OpenAsTextStream(OpenFileForReading)
Do While Not TextStream.AtEndOfStream
S = S TextStream.ReadLine NewLine
Loop
TextStream.Close

GetLyrics = S

End Function

標(biāo)簽:上海 邢臺(tái) 楚雄 涼山 南京 赤峰 通遼 清遠(yuǎn)

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《filesystemobject組件的用法示例》,本文關(guān)鍵詞  filesystemobject,組件,的,用法,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《filesystemobject組件的用法示例》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于filesystemobject組件的用法示例的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    巴塘县| 读书| 安新县| 天门市| 隆安县| 琼结县| 华蓥市| 双峰县| 临沭县| 徐州市| 府谷县| 环江| 游戏| 平阴县| 高雄市| 百色市| 大丰市| 嫩江县| 德庆县| 白水县| 桃园县| 卓资县| 金寨县| 衡阳市| 金沙县| 连平县| 潼关县| 武山县| 阿坝| 阿拉尔市| 班戈县| 孝昌县| 德惠市| 报价| 漯河市| 寿阳县| 大足县| 台南县| 南通市| 英山县| 仙桃市|