diff --git "a/33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" "b/33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" new file mode 100644 index 0000000000000000000000000000000000000000..1ef81dc2e07afe8011088d6d38eeeaf230723ee3 --- /dev/null +++ "b/33\347\211\233\346\226\207\350\275\251/ASP.NET\344\275\234\344\270\232/WebForm1.aspx.cs" @@ -0,0 +1,58 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1 +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void Button1_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = a + b; + Label1.Text = aa.ToString(); + } + + protected void Button2_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = a - b; + Label1.Text = aa.ToString(); + } + + protected void Button3_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = a * b; + Label1.Text = aa.ToString(); + } + + protected void Button4_Click(object sender, EventArgs e) + { + double a = double.Parse(TextBox1.Text); + double b = double.Parse(TextBox2.Text); + double aa = 0; + if (b == 0) + { + Label1.Text = "除数不能为0"; + return; + } + else { + + aa = a / b; + } + Label1.Text = aa.ToString(); + } + } +} \ No newline at end of file diff --git "a/33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" "b/33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" new file mode 100644 index 0000000000000000000000000000000000000000..33e36a8d5633c33f6b008d54b13e63267f54f846 --- /dev/null +++ "b/33\347\211\233\346\226\207\350\275\251/\344\275\234\344\270\232/WebForm1.aspx.cs" @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebApplication1 +{ + public partial class WebForm1 : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (!Page.IsPostBack) { + SqlDataSource1.SelectCommand = "select * from city where type=1 "; + + SqlDataSource2.SelectCommand = "select * from city where type=2 and pid=2"; + SqlDataSource3.SelectCommand = "select * from city where type=3 and pid in (select id from city where type = 2 and pid = 2)"; + } + + } + + protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) + { + SqlDataSource2.SelectCommand = "select * from city where type=2 and pid=" + DropDownList1.SelectedValue; + SqlDataSource3.SelectCommand = "select * from city where type=3 and pid in (select id from city where type = 2 and pid = " + DropDownList1.SelectedValue+")"; + } + + protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e) + { + SqlDataSource3.SelectCommand = "select * from city where type=3 and pid =" + DropDownList2.SelectedValue; + } + + protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file