把“...”替换成你要初始化的数据。一个简单的例子: 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 = {
泊头网站建设公司成都创新互联,泊头网站设计制作,有大型网站制作公司丰富经验。已为泊头上1000家提供企业网站建设服务。企业网站搭建\成都外贸网站建设要多少钱,请找那个售后服务好的泊头做网站的公司定做!
Module Module1
Sub Main()
Dim i, k As Integer
Dim a(,) As Integer = {{1, 2}, {2, 4}, {3, 4}}
For i = 0 To 2
For k = 0 To 1
Console.Write("a({0},{1})={2} ", i, k, a(i, k))
Next
Console.WriteLine()
Next
Console.Read()
End Sub
End Module
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 oldTime As Date = Now
在过程语句后加
Dim newTime As Date = Now
Dim differenceInSeconds As Long = DateDiff(DateInterval.Second, oldTime, newTime)
textbox1.text= "共用了:" differenceInSeconds "秒!"