求C#大神逐句解释一下 ,急急急!!!!!

DataSetresult=newDataSet();result=newClass1().hsggetdata(sql);//result=newTestOnline.... DataSet result = new DataSet();
result = new Class1().hsggetdata(sql);
// result = new TestOnline.Class1().hsggetdata(sql);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{
Session["username"] = TextBox1.Text.ToString().Trim();

if (cx.Text.ToString().Trim() == "管理员")
{
Session["cx"] = result.Tables[0].Rows[0]["cx"].ToString().Trim();
}
else
{
Session["cx"] = cx.Text.ToString().Trim();

}
Response.Redirect("main.aspx");
}
else
{
Response.Write("<script>javascript:alert('对不起,用户名或密码不正确,或您的帐号未经审核!');</script>");
}
}
else
{
Response.Write("<script>javascript:alert('对不起,系统错误,请不要越权操作!');</script>");
}
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("yonghuzhuce_add.aspx");
}
}
}
else
{
Response.Write("<script>javascript:alert('对不起,用户名或密码不正确,或您的帐号未经审核!');</script>");
}
}
else
{
Response.Write("<script>javascript:alert('对不起,系统错误,请不要越权操作!');</script>");
}
}

protected void Button2_Click(object sender, EventArgs e)
{
Response.Redirect("yonghuzhuce_add.aspx");
}
}
明天答辩,求好心人告知
展开
 我来答
内裤最大功能
推荐于2016-01-04 · TA获得超过3105个赞
知道大有可为答主
回答量:3201
采纳率:79%
帮助的人:1249万
展开全部
DataSet result = new DataSet();//定义DataSet对象,是一种存在内存里的数据集合
result = new Class1().hsggetdata(sql);//调用Class1这个类里的hsggetdata()函数给result赋值。
if (result != null)//如果result不为空
{
    if (result.Tables[0].Rows.Count > 0)//如果result里的第一张表的行数大于0
    {
        Session["username"] = TextBox1.Text.ToString().Trim();//就给Session对象里的username赋值。
        if (cx.Text.ToString().Trim() == "管理员")//判断cx这个的显示文字
        {
            Session["cx"] = result.Tables[0].Rows[0]["cx"].ToString().Trim();
        }
        else
        {
            Session["cx"] = cx.Text.ToString().Trim();
                    
        }
        Response.Redirect("main.aspx");
     }
     else
     {
         //执行javascript代码,在页面弹框显示这句话。。。。。
         Response.Write("<script>javascript:alert('对不起,用户名或密码不正确,或您的帐号未经审核!');</script>");
            }
        }
        else
        {
            Response.Write("<script>javascript:alert('对不起,系统错误,请不要越权操作!');</script>");
        }
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        //点击button2就执行Button2_Click这个函数,让跳转到yonghuzhuce_add.aspx这个页面
        Response.Redirect("yonghuzhuce_add.aspx");
    }
}
  }
            else
            {
                Response.Write("<script>javascript:alert('对不起,用户名或密码不正确,或您的帐号未经审核!');</script>");
            }
        }
        else
        {
            Response.Write("<script>javascript:alert('对不起,系统错误,请不要越权操作!');</script>");
        }
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        Response.Redirect("yonghuzhuce_add.aspx");
    }
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式