求高手帮忙把这个循环从VB转化成C#
VB6.0版本:
For i = 1 To 60
Retstr(i) = ReadfromIni(App.Path & "\PointTable2.ini", "Items", "Itm" & (i))
Set oitem(i) = TheOPCitems.AddItem(Retstr(i), i)
oitem(i).IsActive = True
Next i
VB.NET版本:
For i = 1 To 60
Retstr(i) = ReadfromIni(My.Application.Info.DirectoryPath & "\PointTable2.ini", "Items", "Itm" & (i))
oitem(i) = TheOPCitems.AddItem(Retstr(i), i)
oitem(i).IsActive = True
Next i
C# code:
for (int i = 1; i <= 60; i++)
{
Retstr(i) = ReadfromIni(App.Path & @"\PointTable2.ini", "Items", "Itm" & (i));
oitem(i) = TheOPCitems.AddItem(Retstr(i), i);
oitem(i).IsActive = True;
}
C# code:
for(int i = 1;i <=60;i++)
{
Retstr(i) = ReadfromIni(My.Application.Info.DirectoryPath + "\PointTable2.ini", "Items", "Itm" + i.ToString());
oitem(i) = TheOPCitems.AddItem(Retstr(i), i);
oitem(i).IsActive = True;
}
大概是这样?
记错了
相关问答:
login.aspx.vb:
Public ReadOnly Property nameT() As String
Get
Return TextBox1.Text
&nb ......
要用vb打印一条线,长度是100毫米怎么写?
关注
VB code:
Printer.ScaleMode = vbMillimeters
Printer.Line (10, 10)-(110, 10)
Printer.ScaleMode = vbMillimeters
Print ......
就是设计一个计算机模拟考试系统,带有学生和管理员,所以登录窗体和主窗体想分开,登陆学生的显示学生的主窗体,登陆管理员显示管理主窗体,我只会一个窗体用一堆控件,现在享有多个主窗体,不知道怎么做,希望请大 ......
Private Sub Check1_Click()
If Check1.Value = 1 Then
DTP1.Enabled = True
Else
DTP1.Enabled = False
End If
End Sub
Private Sub Check2_Click()
If Check2.Value = 1 Then
DTP2.Enabled = True
Else
......