国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Visual Basic > 正文

VB實(shí)現(xiàn)按行讀取文本文件的方法

2020-01-31 16:30:48
字體:
供稿:網(wǎng)友

本文實(shí)例講述了VB實(shí)現(xiàn)按行讀取文本文件的方法。分享給大家供大家參考。具體如下:

'(general declaration)Dim nFileNum As Integer, sText As String, sNextLine As String, lLineCount As Long'==================================Private Sub Command1_Click()' Get a free file numbernFileNum = FreeFile' Open a text file for input. inputbox returns the path to read the fileOpen "C:/Documents and Settings/Sudeep/My Documents/3.txt" For Input As nFileNumlLineCount = 1' Read the contents of the fileDo While Not EOF(nFileNum)  Line Input #nFileNum, sNextLine  'do something with it  'add line numbers to it, in this case!  sNextLine = sNextLine & vbCrLf  sText = sText & sNextLineLoopText1.Text = sText' Close the fileClose nFileNumEnd Sub

希望本文所述對大家的VB程序設(shè)計有所幫助。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 阿拉善盟| 潜山县| 汉源县| 平凉市| 红桥区| 磴口县| 怀仁县| 九台市| 和顺县| 图们市| 蒲城县| 武夷山市| 扬州市| 泾阳县| 鹤山市| 敦化市| 玉山县| 炎陵县| 湛江市| 唐海县| 富川| 营山县| 浠水县| 长宁区| 桃园市| 益阳市| 东港市| 昌都县| 溧阳市| 泉州市| 潼关县| 泰来县| 彭州市| 通海县| 扎兰屯市| 东乌| 阿勒泰市| 淮滨县| 瑞安市| 吉隆县| 大连市|