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

📄 students.ascx.cs

📁 this is code for all person who want ro larn vb
💻 CS
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class controls_students : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        string fn="not found";
        string loc="";
        if(FileUpload1.PostedFile!=null && FileUpload1.PostedFile.ContentLength>0)
        {
           fn=System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
            loc=Server.MapPath("~/cvs");
            FileUpload1.PostedFile.SaveAs(loc+"/"+fn);

        
        }


        SqlDataSource1.InsertParameters[0].DefaultValue = txtid.Text;
        SqlDataSource1.InsertParameters[1].DefaultValue =txtname.Text;
 
            SqlDataSource1.InsertParameters[2].DefaultValue = txtmajor.Text;
            SqlDataSource1.InsertParameters[3].DefaultValue = txtaddress.Text;
            SqlDataSource1.InsertParameters[4].DefaultValue = txtmail.Text;
            SqlDataSource1.InsertParameters[5].DefaultValue = txtphone.Text;
            SqlDataSource1.InsertParameters[6].DefaultValue = txtyear.Text;
            SqlDataSource1.InsertParameters[7].DefaultValue = txtpass.Text;
            SqlDataSource1.InsertParameters[8].DefaultValue = fn;
            SqlDataSource1.Insert();
            txtaddress.Text = txtid.Text = txtmail.Text = txtmajor.Text = txtname.Text = txtpass.Text = txtphone.Text = txtyear.Text = "";



    }
    protected void txtid_TextChanged(object sender, EventArgs e)
    {
        password p=new password();
        txtpass.Text = p.getPassword(txtid.Text);

    }
}

⌨️ 快捷键说明

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