急!!!根据时间将两个不同结构数组合并成一个数组
如题,有以下两个数据结构
Public Structure WSpeedOut
Public time As Date
Public Id As Integer
Public Speed As Single
End Structure
Public Structure FGradeOut
Public time As Date
Public grade As Single
End Structure
需要根据时间将相同时间两个数据合并起来 变成像下面这样结构的数据
Time Id Speed grade
2013-08-04 09:01:23 1 123.01 95.5
--------------------编程问答-------------------- Dim query = From w In WSpeedOutList
Join f In FGradeOut On w.time Equals f.time
Select New With { w.time, w.id, w.speed, f.grade } --------------------编程问答-------------------- 不用linq有没有其他方法可以实现啊 --------------------编程问答-------------------- 用SortList来完成,定义两个SortList,比如WSpeedOutList和FGradeOutList,用time作为它们的Key来定位数据,即如下
WSpeedOutList.add(WSpeedOut.time,WSpeedOut)
FGradeOutList.add(FGradeOut.time,FGradeOut)
for each a as object in WSpeedOutList.values
dim b as WSpeedOut=a
dim c as FGradeOut=FGradeOutList.item(b.time)
debug.print(string.format("time:{0} id:{1} speed:{2} grade:{3}",b.time,b.id,b.speed,c.grade))
next
补充:.NET技术 , VB.NET