一段vb.net 改写成 c# 代码的 出现的问题 请高手 帮帮我
vb.net 代码
Dim node As New TreeNode
node.Text = "所有分类"
Me.Nodes.Add(node)
AddNode(node, GradeInfos, 1, bShowCode)
For Each node In getNodes()
If Code = Global.Common.Functions.getCode(node.Text) Then
Me.SelectedNode = node
End If
Next
If Me.SelectedNode Is Nothing Then
Me.SelectedNode = Me.Nodes(0)
End If
改写成C#代码
TreeNode node = new TreeNode();
node.Text = "所有分类";
this.Nodes.Add(node);
AddNode(node, GradeInfos, 1, bShowCode);
foreach (node in getNodes())
{
if (Code == global::Common.Functions.getCode(node.Text))
{
this.SelectedNode = node;
}
}
if (this.SelectedNode == null)
{
this.SelectedNode = this.Nodes(0);
}