求VB读取程序文件夹下的name.txt并将其内文件作为文本去执行文件? 25

'添加Command1Text1Timer1Dima()AsStringDimi%,cjnum%,tper%,groupname$PrivateSubForm_Load(... '添加 Command1 Text1 Timer1
Dim a() As String
Dim i%, cjnum%, tper%, groupname$
Private Sub Form_Load()
groupname = "A,B,C,D,E,F,G,H,I"
Call getname
Timer1.Interval = 10
Timer1.Enabled = False
Command1.Caption = "开始"
Me.Cls
Text1.Text = "请点击按钮开始"
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
End Sub
Private Sub Command1_Click()
Timer1.Enabled = Not Timer1.Enabled
Command1.Caption = IIf(Command1.Caption = "停止", "开始", "停止")
If Timer1.Enabled = False Then
Print Text1.Text
If cjnum = tper - 1 Then
groupname = Replace(groupname, "," & Text1.Text, "")
Else
groupname = Replace(groupname, Text1.Text & ",", "")
End If
If Trim(groupname) = "" Or InStr(groupname, ",") = 0 Then
Print groupname
MsgBox "本轮抽号已结束!"
groupname = "A,B,C,D,E,F,G,H,I"
Me.Cls
Text1.Text = "请点击按钮开始"
Else
Call getname
End If
End If
End Sub
Private Sub Timer1_Timer()
cjnum = Int(Rnd * tper)
Text1.Text = a(cjnum)
End Sub
Sub getname()
Dim xm
xm = Split(groupname, ",")
tper = UBound(xm) + 1
ReDim a(tper) As String
For i = 0 To tper - 1
a(i) = xm(i)
Next i
End Sub

在上述程序中,name.txt内文本为"A,B,C,D,E,F,G,H,I",那么如何让VB正常读取和运行软件呢?
展开
 我来答
865075389
2011-02-26
知道答主
回答量:34
采纳率:0%
帮助的人:11.1万
展开全部
abcdefg
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式