1、 dim out as string Open "TESTFILE" For Output read As #1 do until eof(#1) line input #1 ,nextline out=out+nextline+vbcrlf loop Close #1
dim out as string Open "TESTFILE" For INPUT read As #1 do until eof(#1) line input #1 ,nextline out=out+nextline+vbcrlf combobox.AddItem OUT loop Close #1
input read 不能用呀。提示出错。
Private Sub Form_Load() Dim out As String Dim pathname As String pathname = "d:\vbhelp.txt" Open pathname For Input As #1Do Until EOF(1) Line Input #1, nextline out = out + nextline + vbCrLf Combo1.AddItem out Loop Close #1 End Sub
Private Sub Form_Load() Dim out As String Dim pathname As String pathname = "filename" '你要打开的文件 Open pathname For Input As #1Do Until EOF(1) Line Input #1, linetext Combo1.AddItem linetext Close #1 End Sub
Private Sub Form_Load() Dim out As String Dim pathname As String pathname = "d:\vbhelp.txt" Open pathname For Input As #1Do Until EOF(1) Line Input #1, nextline out = nextline + vbCrLf Combo1.AddItem out Loop Close #1 Combo1.ListIndex = 0End Sub
dim out as string
Open "TESTFILE" For Output read As #1
do until eof(#1)
line input #1 ,nextline
out=out+nextline+vbcrlf
loop
Close #1
Open "TESTFILE" For INPUT read As #1
do until eof(#1)
line input #1 ,nextline
out=out+nextline+vbcrlf
combobox.AddItem OUT
loop
Close #1
Dim out As String
Dim pathname As String
pathname = "d:\vbhelp.txt"
Open pathname For Input As #1Do Until EOF(1)
Line Input #1, nextline
out = out + nextline + vbCrLf
Combo1.AddItem out
Loop
Close #1
End Sub
Dim out As String
Dim pathname As String
pathname = "filename" '你要打开的文件
Open pathname For Input As #1Do Until EOF(1)
Line Input #1, linetext
Combo1.AddItem linetext
Close #1
End Sub
Dim out As String
Dim pathname As String
pathname = "d:\vbhelp.txt"
Open pathname For Input As #1Do Until EOF(1)
Line Input #1, nextline
out = nextline + vbCrLf
Combo1.AddItem out
Loop
Close #1
Combo1.ListIndex = 0End Sub
1.第一条
2.第二条
3.第三条而上面语句显示出来却是:
1.第一条
1.第一条2.第二条
1.第一条2.第二条3.第三条