![]() |
中国DOS联盟-- 联合DOS 推动DOS 发展DOS --联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum |
| 游客 | 登录 | 注册 | 会员 | 搜索 | 中国DOS联盟 |
|
中国DOS联盟论坛 现在时间是 2026-08-09 01:18 |
共 47,811 主题排行 / 349,895 发帖 / 今日 0 篇 / 48,253 会员排行 |
| DOS批处理 & 脚本技术(批处理室) » [求助]VBS问题 |
| 可打印版本 606 / 3 |
| 第1楼 joyn | 发表于 2008-06-03 19:20 |
| 中级用户 发帖 105 积分 280 来自 广西 | |
|
[求助]VBS问题 用VBS怎么反回一个TXT文件的行数.
|
|
| 第2楼 slore | 发表于 2008-06-03 19:50 |
| 铂金会员 发帖 2,478 积分 5,212 | |
|
readline自己数……
readall后split……去数组上限 |
|
| 第3楼 joyn | 发表于 2008-06-03 20:40 |
| 中级用户 发帖 105 积分 280 来自 广西 | |
|
[结] thank you!
不过已结了~~我用的是 On Error Resume Next On Error Resume Next Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile("d:\11.txt", 1) Do While True If 1 Then lines = objfile.ReadLine If Err.Number <> 0 Then WScript.Echo "#"&Err.Number&Space (5)&"lines="&m Err.Clear Exit Do End If m=m+1 End If Loop Set objfso = nothing [ Last edited by joyn on 2008-6-3 at 09:03 PM ] |
|
| 第4楼 sonicandy | 发表于 2008-06-18 21:56 |
| 中级用户 发帖 91 积分 273 | |
|
set fso = createobject("scripting.filesystemobject")
set stream = fso.opentextfile("d:\11.txt",1,false) if not stream.atendofstream then content = stream.readall() linecount = ubound(split(content,vbcrlf)) + 1 else linecount = 0 end if call stream.close call msgbox(linecount) [ Last edited by sonicandy on 2008-6-18 at 09:59 PM ] |
|
|
[ 联系联盟系统管理团队 -
中国DOS联盟 -
标准版 ] Sponsored by ifanr Inc | © 2001–2023 |