Dim abc(2) As Integer
创新互联专业为企业提供陆丰网站建设、陆丰做网站、陆丰网站设计、陆丰网站制作等企业网站建设、网页设计与制作、陆丰企业网站模板建站服务,十载陆丰做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。
abc = {0, 1, 2}
'或者
Dim abcd() As Integer
ReDim abcd(9)
For i As Integer = 0 To abcd.Length - 1
abcd(i) = i
Next
也可声明为字符串数组
把“...”替换成你要初始化的数据。一个简单的例子: Dim a(3) As Integer = { 0, 1, 2 }**修改**既然有界数组不能初始化,就还缺(省)界数组试试嘛: Dim a() As Integer = { 0, 1, 2 } 类型不匹配的错误估计是你的结构体缺少构造函数造成的。在你的quality_i结构体定义里面加一个构造函数,如下所示 Public Structure quality_i Public nub As Integer Public nae As String Public Sub New(ub As Integer, ae As String)nub = ubnae = aeEnd SubEnd Structure 然后以如下方式初始化: Dim k() As quality_i = {
数组好像没有快速赋值吧,或者你再把问题再清楚一点。
语句执行时间倒是可以做到。在语句前
Dim oldTime As Date = Now
在过程语句后加
Dim newTime As Date = Now
Dim differenceInSeconds As Long = DateDiff(DateInterval.Second, oldTime, newTime)
textbox1.text= "共用了:" differenceInSeconds "秒!"