请高手帮助改一下VB代码
这段代码在VB6中运行时,老是有错误提示
请帮忙给改一下,只要能正常运行就可以!谢谢!
VB code:
Private Type Info
Name As String
Num1 As String
Num2 As String
End Type
Dim a() As Info
Dim FileName As String
FileName = "\1.ini" '修改ini文件名
Private Sub Combo1_Click()
Text1(0).Text = a(Combo1.ListIndex).Name
Text1(1).Text = a(Combo1.ListIndex).Num1
Text1(2).Text = a(Combo1.ListIndex).Num2
End Sub
Private Sub Command1_Click(Index As Integer)
If Index = 0 Then
Open App.Path & FileName For Append As #1
Print #1, ""
Print #1, Trim(Text1(0).Text) & "|" & Trim(Text1(1).Text) & "|" & Trim(Text1(2).Text)
Close #1
a(UBound(a)).Name = Text1(0).Text
a(UBound(a)).Num1 = Text1(1).Text
a(UBound(a)).Num2 = Text1(2).Text
ReDim Preserve a(UBound(a) + 1)
MsgBox "添加成功"
Call RefreshIni
ElseIf Index = 1 Then
If Combo1.ListIndex >= 0 Then
a(Combo1.ListIndex).Name = Text1(0).Text
a(Combo1.ListIndex).Num1 = Text1(1).Text
a(Combo1.ListIndex).Num2 = Text1(2).Text
Open App.Path & FileName For Output As #1
Print #1, "[config]"
For i = 0 To UBound(a) - 1
Print #1, Trim(a(i).Name) & "|" & Trim(a(i).Num1) & "
相关问答:
我有厂家做的ASP的监控录像(DVR)的局域网播放的源程序与控件,想要用ASP.net做一个视频回放的程序(利用他的控件)但不知如下去做,望各位指点。
先搞清楚他们的控件是怎么用的,
然后就直接用好了.
不过,如 ......
请教一下:我用vb写了一个调用Illustrator的测试程序,代码很简单:Private Sub Command1_Click()
Dim app As New Illustrator.Application
Dim doc As Illustrator.Document
Dim thislayer As Illustrator.Layer ......
为什么工具栏按扭的宽度改变不了,在属性里改了又变成原来的数值了
大胡子真厉害,回答基本都是爆料级的
大胡子升级真快啊,这才几天就5条短裤外加月排名第一了
想想我这5个短裤混了差不多8年才得到的。
回复 ......
自己采用的是Set objWMIService = GetObject("winmgmts:\\"&computername&"\root\cimv2"),其中computername是局域网一台电脑的IP或计算机名,但使用这个wmi语句对远程计算机进行操作时 ......
我是VB的新成员,现在想用VB来做个TXT文档,请大家给我代码及介绍一下相应的控件!
非常感谢!!!!!!
可以用一些OFFICE控件
google上找一下吧,VB写入TXT,很多样例代码的
直接调查用就可以了
面对美女 ......