}
}
ÈÎÎñÈý£º
Éè¼ÆÒ»¸öС¼ÆËãÆ÷£¬Äܹ»½øÐлù±¾µÄ¼Ó£¬¼õ£¬³Ë£¬³ýÔËËã¼´¿É£¬³ÌÐòÔËÐÐЧ¹ûÈçͼ£º
¾ßÌå²Ù×÷²½Ö裺 1.½¨Á¢ÍøÕ¾£º 2.Éè¼ÆÒ³Ãæ£º
3.Ìí¼Ó¿Ø¼þ¼°ÉèÖÃÊôÐÔ£º 4.±àдʼþ´úÂ룺
using System;
using System.Configuration; using System.Data; using System.Linq; using System.Web;
using System.Web.Security; using System.Web.UI;
using System.Web.UI.HtmlControls; using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts; using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e)
{
this.Title = \ÎÒµÄС¼ÆËãÆ÷\ txtresult.ReadOnly = true;
14
}
protected void Button1_Click(object sender, EventArgs e) {
float fnum1 = 0, fnum2 = 0, fresult = 0; fnum1 = float.Parse(txtnum1.Text); fnum2 = float.Parse(txtnum2.Text);
string strope = dropclass.SelectedValue; switch (strope) {
case \
fresult = fnum1 + fnum2; break; case \
fresult = fnum1 - fnum2; break; case \
fresult = fnum1 * fnum2; break; case \
fresult = fnum1 / fnum2; break; }
txtresult.Text = fresult.ToString(); }
protected void Button2_Click(object sender, EventArgs e) {
txtnum1.Text = \ txtnum2.Text = \ txtresult.Text = \ }
}
ÈÎÎñËÄ£º
ÖÆ×÷ÈçͼËùʾµÄÓû§×¢²áÒ³Ãæ£¬µ±µ¥»÷¡°×¢²á¡±°´Å¥ºó¾ÍÔÚLabel¿Ø¼þÖÐÏÔʾÏàӦע²áÐÅÏ¢£¬µ±µ¥»÷¡°ÖØÖá±°´Å¥ºóËùÓеÄÐÅÏ¢Çå¿Õ¡£
15
¾ßÌå²Ù×÷²½Ö裺 1.½¨Á¢ÍøÕ¾£º 2.Éè¼ÆÒ³Ãæ£º
3.Ìí¼Ó¿Ø¼þ¼°ÉèÖÃÊôÐÔ£º 4.±àдʼþ´úÂ룺
using System;
using System.Configuration; using System.Data; using System.Linq; using System.Web;
using System.Web.Security; using System.Web.UI;
using System.Web.UI.HtmlControls; using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts; using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page {
protected void Page_Load(object sender, EventArgs e) { }
protected void Button1_Click(object sender, EventArgs e)
16
{
Label1.Text = \ÄúµÄ¸öÈËÐÅÏ¢ÈçÏÂ:
\ string message = \
message += \ÐÕÃû£º\ message += \ÃÜÂ룺\
message += \ÐÔ±ð£º\ message += \³öÉúÈÕÆÚ£º\
message += \רҵ£º\+ ddlspeciality.SelectedItem.Text + \ message += \°®ºÃ£º\
for (int j = 0; j < Chkhobby.Items.Count; j++) {
if (Chkhobby.Items[j].Selected == true) {
message += \ }
}
message += \ÁªÏµµØÖ·£º\ message += \ÓÊÕþ±àÂ룺\ message += \ÁªÏµµç»°£º\
message += \¼ò½é£º\ Label1.Text += message; }
protected void Button2_Click(object sender, EventArgs e) {
txtname.Text = \ txtpwd.Text = \ txtpwd1.Text = \
Rdoltsex.ClearSelection(); txtbirthday.Text = \
ddlspeciality.ClearSelection(); Chkhobby.ClearSelection(); txtaddress.Text = \ txtyb.Text = \ txttel.Text = \
txtintroduction.Text = \ Label1.Text = \ }
}
ÈÎÎñÎ壺
ʹÓÃFILeUpLoad¿Ø¼þÉÏ´«Í¼ÏóÎļþµ½Web·þÎñÆ÷£¬²¢½«Í¼ÏóÎļþÔÚImage¿Ø¼þÖÐÏÔʾ³öÀ´£¬Í¬Ê±ÒªÏÔʾ³öÎļþÉÏ´«µÄÏà¹ØÐÅÏ¢¡£
³ÌÐòÆô¶¯ºó£¬ÓÉÓÚûÓÐÉÏ´«Í¼Ïó£¬ËùÒÔ´ËʱImage¿Ø¼þÏÔÊ¾Ìæ»»Îı¾¡°ÉÐδÉÏ´«Í¼Ïó¡±Èçͼ£»Í¼ÏóÎļþÉÏ´«³É¹¦£¬Ìáʾ¡°ÎļþÉÏ´«³É¹¦¡±£¬²¢ÔÚImage¿Ø¼þÖÐÏÔ
17