使用File System Object
www.applevb.com
www.applevb.com
解决方案 »
- 200分:如何创建类似组合框下拉列表样式的窗体?
- 请教OCX控件的一个棘手问题(OCX控件是用vc编写的)
- 程序运行方面的问题!
- datareport的小问题,大家帮一下忙
- 关于文件操作的问题!(好人啊,快来帮帮我这个初学者吧)
- 小弟论坛开张了,请大家有空去坐坐阵!(注:是动网论坛,小弟无能力自己编)
- 请问VB是否有栯圆或其它的美术按钮控件?难道VB没这个功能吗?
- VB6.0怎么读取ISA板卡数据
- 关于汉字书写教学以何种方式实现的问题(帮忙up有分),急用,谢谢帮忙!
- 为什么在win2000 server上好好的,在win98上出现乱码?????
- 麻烦各个位高手谈一下API函数的重要性以及在哪些地方要用到API 函数!
- 问大家几个有关sql server的问题。
dim c as integer
dim fn as integer
dim str as string
fn=freefile
open filename for input as #fn
while not eof(fn)
line input #fn, str
c=c+1
wend
close #fn
GetLineCount = c
end function
而且文本很大的话,速度会非常慢
次请教,如何在代码中判断换行符chr(10)个数呢?
dim c as integer
open filename for binary as #1
while not eof(1)
input #1, ch
if ch=chr(10) then c=c+1
wend
close #1
function GetLineCount(filename as string) as integer
dim c as integer
dim fn as integer
dim str as string
fn=freefile
open filename for input as #fn
while not eof(fn)
line input #fn, str
c=c+Len(Replace(str, Chr(10), "aa")) - Len(str)
wend
close #fn
GetLineCount = c
end function
det tetfile=fs.createtextfile("Firing_sky.txt",True")
i=0
while txtfile.Atendogstream=false then
textfile.skipline
i=I+1
loop
txtfile.close
原:c=c+Len(Replace(str, Chr(10), "aa")) - Len(str)
改为:c=c+Len(Replace(str, Chr(10), "aa")) - Len(str) +1
外几位朋友也没少出力,大家都辛苦了,我以白开水代酒,先敬大家一杯(我作手状),
“咕噜”,我喝完了,相信大家都喝得很痛快吧,既然如此,那我们还是乘着酒劲,把剩下
的问题----"如何在VB6中动态生成一定数量的控件?"也给消灭了吧,大家冲啊,杀呀到隔壁去!!!