日期:2014-05-18 浏览次数:20462 次
protected void Page_Load(object sender, EventArgs e) { } public void upload() { int nu = 0; Random random = new Random(); for (int i = 0; i < ListTest().Count; i++) { nu = random.Next(ListTest().Count); this.Label1.Text = ListTest()[nu].ToString(); } } public List<string> ListTest() { List<string> list = new List<string>(); Tab_Random zhinan_class = (Tab_Random)Tab_RandomManager.Instance.GetModelTab_RandomByWhere("numid=0 order by newid()"); list.Add(zhinan_class.Daqu); return list; } protected void Button1_Click(object sender, EventArgs e) { this.Timer1.Enabled = !this.Timer1.Enabled; Label2.Text = "".ToString(); } protected void Timer1_Tick(object sender, EventArgs e) { upload(); } protected void asdasda_Click(object sender, EventArgs e) { Tab_Random zhinan = (Tab_Random)Tab_RandomManager.Instance.GetModelTab_RandomByWhere("daqu='" + Label1.Text.ToString() + "'"); string dadada = zhinan.Daqu.ToString(); AnswerDAL.Intance.ModifyTab_Random(dadada); } protected void Button2_Click(object sender, EventArgs e) { AnswerDAL.Intance.ModifyTab_RandomAll(); } protected void Timer2_Tick(object sender, EventArgs e) { uploadone(); } public void uploadone() { int nu = 0; Random random = new Random(); for (int i = 0; i < ListTest().Count; i++) { nu = random.Next(ListTest().Count); this.Label2.Text = ListTestone()[nu].ToString(); } } public List<string> ListTestone() { List<string> list = new List<string>(); Tab_Random zhinan_class = (Tab_Random)Tab_RandomManager.Instance.GetModelTab_RandomByWhere("numid=0 and daqu='" + Label1.Text .ToString()+ "' order by newid()"); list.Add(zhinan_class.Name); return list; }