这段代码什么意思?请教大神。

qq_34669511 2016-04-15 11:58:32
public partial class kaoshi : System.Web.UI.Page
{
public int int_row1 = 0;
public int int_row1Point = 0;
public int hsgzf = 0;
protected void Page_Load(object sender, EventArgs e)
{
//string dd1 = Application["d1"].ToString();
//string dd2 = Application["d2"].ToString();

if (Session["username"] != null)
{ }
else
{
Response.Write("<script>javascript:alert('对不起,请您先登陆!');history.back();</script>");
Response.End();
}
if (!IsPostBack)
{
Button2.Visible = false;
string sql;
sql = "select top 5 * from shiti where 1=1 order by newid() desc";
DataSet result = new DataSet();
result = new Class1().hsggetdata(sql);
if (result != null)
{
if (result.Tables[0].Rows.Count > 0)
{

DataList1.DataSource = result.Tables[0];
DataList1.DataBind();

}
else
{
DataList1.DataSource = null;
DataList1.DataBind();
}
}
for (int tID1 = 1; tID1 <= DataList1.Items.Count; tID1++)
{
Label lblSelect = (Label)DataList1.Items[tID1 - 1].FindControl("Label2");
lblSelect.Text = tID1.ToString() + "、";
Label lblSelect2 = (Label)DataList1.Items[tID1 - 1].FindControl("Label1");
lblSelect2.Visible = false;
}
}

}
...全文
647 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_34669511 2016-04-15
  • 打赏
  • 举报
回复
求教大神解释最好详细点。菜鸟看不懂。

1,316

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder 网络及通讯开发
社区管理员
  • 网络及通讯开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧