求助 C#代码翻译 VB.net
vb.net吧
全部回复
仅看楼主
level 1
xxmingok 楼主
请问大侠们,该段C#代码翻译成VB的怎么写
Void GetData()
{
IList<object> list = new List<object>();
for (var i = 0; i < 100; i++)
{
list.Add(new
{
id = i,
name = "部门" + i,
remark = "部门" + i + " 备注"
});
}
var griddata = new { Rows = list };
string s = new JavaScriptSerializer().Serialize(griddata);
Response.Write(s);
}
2012年08月13日 08点08分 1
level 12
Class [Object]
Property id As Integer
Property name As String
Property remark As String
End Class
Class GridData
Property Rows As List(Of [Object])
End Class
Sub GetData()
Dim list As IList(Of [Object]) = New List(Of [Object])
For i = 0 To 99
list.Add(New [Object] With {.id = i, .name = "部门" & i, .remark = "部门" & i & "备注"})
Next
Dim griddata As New GridData With {.Rows = list}
Dim s As String = New JavaScriptSerializer().Serialize(griddata)
Response.Write(s)
End Sub
2012年08月21日 03点08分 2
level 3
http://blog.csdn.net/jabby12/article/details/107858
给你个网站,以后去这找转的。
2012年09月12日 13点09分 3
1