⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex4.aspx.cs

📁 这是个通讯录的源代码,里面实现对信息的添加,删除和修改
💻 CS
字号:
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public class ex4 : System.Web.UI.Page {
  protected DropDownList kind;
  protected TextBox Emailname;
  protected TextBox Yourname;
  protected TextBox Youraddress;
  protected TextBox code;
  protected TextBox company;
  protected TextBox phone;
  protected TextBox age;
  protected TextBox people;
  protected Button submit;
  protected Label message;


// OnLoad handler to populate the dropdownlist

  override protected void OnLoad(EventArgs e) {
    if (!IsPostBack) {
      kind.Items.Add(new ListItem("学校"));
      kind.Items.Add(new ListItem("政府部门"));
      kind.Items.Add(new ListItem("私营企业"));
      kind.Items.Add(new ListItem("国有企业"));
      kind.Items.Add(new ListItem("个体经营"));
    }
  }

// Handler for the button

  protected void OnClickHandler(object src, EventArgs e) {
    string newMsg = string.Format(
        "您好,{0}<br />你注册的邮箱是:{1}@163.com<br />你的个人信息如下:<br /><table border=1><tr><th>家庭地址</th><th>{2}</th></tr><tr><th>地址电话</th><th>{3}</th></tr><tr><th>邮箱密码</th><th>{4}</th></tr><tr><th>工作单位</th><th>{5}</th></tr><tr><th>单位类型</th><th>{6}</th></tr><tr><th>性别</th><th>{7}</th></tr><tr><th>年龄</th><th>{8}</th></tr></table>",Yourname.Text,Emailname.Text,Youraddress.Text,phone.Text,code.Text,company.Text,kind.Text,people.Text,age.Text);
    message.Text = newMsg;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -