VB问题:打开VB6企业版,把下面代码复制到VB里,为什么一运行或者运行后查看对象,VB开发环境
立刻关闭,但有的计算机上运行,就不会出现这种情况。我电脑的VB怎么了?如何修复?我的电脑也不卡PrivateSubCommand1_click()Dims1AsStrin...
立刻关闭,但有的计算机上运行,就不会出现这种情况。我电脑的VB怎么了?如何修复?我的电脑也不卡
Private Sub Command1_click()
Dim s1 As String, s2 As String, s3 As String
Dim s4 As String, s5 As String, s6 As String
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
Dim im
im = Split("1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",")
For i1 = 0 To 35
s1 = im(i1)
For i2 = 0 To 35
s2 = im(i2)
For i3 = 0 To 35
s3 = im(i3)
For i4 = 0 To 35
s4 = im(i4)
For i5 = 0 To 35
DoEvents
s5 = im(i5)
For i6 = 0 To 35
s6 = im(i6)
List1.AddItem s1 & s2 & s3 & s4 & s5 & s6
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1
End Sub 展开
Private Sub Command1_click()
Dim s1 As String, s2 As String, s3 As String
Dim s4 As String, s5 As String, s6 As String
Dim i1 As Integer, i2 As Integer, i3 As Integer
Dim i4 As Integer, i5 As Integer, i6 As Integer
Dim im
im = Split("1,2,3,4,5,6,7,8,9,0,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",")
For i1 = 0 To 35
s1 = im(i1)
For i2 = 0 To 35
s2 = im(i2)
For i3 = 0 To 35
s3 = im(i3)
For i4 = 0 To 35
s4 = im(i4)
For i5 = 0 To 35
DoEvents
s5 = im(i5)
For i6 = 0 To 35
s6 = im(i6)
List1.AddItem s1 & s2 & s3 & s4 & s5 & s6
Next i6
Next i5
Next i4
Next i3
Next i2
Next i1
End Sub 展开
展开全部
你这个程序产生的项目总数是2176782336,已远远超出ListBox控件的项目数上限32767。即使ListBox控件能够放下全部的项目,也需要至少12G以上的内存!不出错就奇怪了!你说的不出错的情况,是因为错误还没到来!因为这个程序要全部运行完毕,最保守估计也要1天以上!
追问
可是学校的电脑还没我家好呢,为什么它一运行就不会立刻关闭VB呢
追答
电脑好不好不要站在你自己的角度来看,要站在程序的角度来看,比如很多软件在WinXP中运行得好好的,到了Win7系统就崩溃,你敢说Win7比WinXP差?
VB6是上个世纪的老古董,它诞生的时候WinXP还没进娘胎呢!所以用VB6编的程序往往在老电脑中反而运行得比较顺畅。如果你用的是Win7,那么出错的可能性就比WinXP要大得多!
我的电脑用了快4年了,昨天我运行你的这个程序,半个小时后报内存溢出,但VB没退出。我的WinXP系统。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询