c#for vb.net中的循环

aca*_*dia 1 vb.net

相当于什么

for (int rowCounter = 0; rowCounter < rowCount; rowCounter++)
{
    for (int columnCounter = 0;columnCounter < columnCount; columnCounter++)
    {
        string strValue = GridView1.Rows[rowCounter].Cells[columnCounter].Text;
        grdTable.AddCell(strValue);
    }
}
Run Code Online (Sandbox Code Playgroud)

在VB.net?

Cec*_*ame 7

For rowCounter As Integer = 0 To rowCount - 1
    For columnCounter As Integer = 0 To columnCount - 1
        Dim strValue As String = GridView1.Rows(rowCounter).Cells(columnCounter).Text
        grdTable.AddCell(strValue)
    Next
Next
Run Code Online (Sandbox Code Playgroud)


Ada*_*eal 6

这是一个非常好的在线转换器:http://www.developerfusion.com/tools/convert/csharp-to-vb/

将C#转换为VB.NET并返回.