vb读取文本文件的某一行

上传人:小** 文档编号:88101638 上传时间:2019-04-19 格式:DOC 页数:1 大小:21.50KB
返回 下载 相关 举报
vb读取文本文件的某一行_第1页
第1页 / 共1页
亲,该文档总共1页,全部预览完了,如果喜欢就下载吧!
资源描述

《vb读取文本文件的某一行》由会员分享,可在线阅读,更多相关《vb读取文本文件的某一行(1页珍藏版)》请在金锄头文库上搜索。

1、Function lines(txtpath As String, ByVal startline As Integer, linenum As Integer) As String 显示 txtpath 文件的从startline 行开始的 linenum 行的内容 lines = Dim filetxt As String, x As Variant, i As Integer filetxt = String(FileLen(txtpath), ) Open txtpath For Binary As 1 Get #1, , filetxt Close 1 x = Split(filet

2、xt, vbCrLf) msgbox ubound(x)+1 行数 If startline UBound(x) Then MsgBox 行溢出, 64, err!: Exit Function If startline = UBound(x) Then If startline + linenum = UBound(x) Then For i = startline To startline + linenum - 1 lines = lines & x(i) & Next Else For i = startline To UBound(x) lines = lines & x(i) & Next End If: End If End Function

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 商业/管理/HR > 管理学资料

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号