随机抽题
随机抽题,从txt1中随机选择一个题目,显示在text1中,从txt2中随机选择一个题目,显示在text2中,使用一个command控制,如何实现啊,求高手指点啊Open Trim$("e:\1.txt") For Input As #1
Do Until EOF(1)
Input #1, Str0
Str1 = Str1 + " " + Str0
Loop
Close #1
stra = Split(Str1, ";")
Str1 = ""
For i = LBound(stra) To UBound(stra)
If stra(i) <> "" Then
Str1 = Str1 + stra(i) + ";"
End If
Next
stra = Split(Str1, ";")
n = UBound(stra)
Randomize
Do Until Flag = False
Text1.Text = stra(Int(Rnd * n))
DoEvents
Loop
使用了这个代码,不能抽取多个txt,头疼啊