C#中的等效代码 [英] Equvilent code in c#

查看:59
本文介绍了C#中的等效代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Protected Sub CheckBoxList1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBoxList1.DataBound  
    For i As Integer = 0 To CheckBoxList1.Items.Count - 1  
           CheckBoxList1.Items(i).Selected = CType(CheckBoxList1.DataSource, IQueryable(Of Permission)).ToList.Item(i).HasAccess          
	Next  
End Sub

推荐答案

尝试 http://www.developerfusion.com/tools/convert/vb-to-csharp/ [

http://www.developerfusion.com/tools/convert/vb-to-csharp/ [
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]

protected void CheckBoxList1_DataBound(object sender, System.EventArgs e)
{
    for (int i = 0; i <= CheckBoxList1.Items.Count - 1; i++) {
        CheckBoxList1.Items(i).Selected = ((IQueryable<Permission>)CheckBoxList1.DataSource).ToList.Item(i).HasAccess;
    }
}


这篇关于C#中的等效代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆