当前位置: 首页 > news >正文

做网站需要的带宽上行还是下行企业网查询官网在线登录入口

做网站需要的带宽上行还是下行,企业网查询官网在线登录入口,网站建设素材图,网站建设学那些课程目录 一、测试要求 二、实现效果 三、实现代码 一、测试要求 二、实现效果 数据库中的内容#xff1a; 使用数据库中的账号登录#xff1a; 若不是数据库中的内容#xff1a; 三、实现代码 login.aspx文件#xff1a; % Page LanguageC# AutoEventW…目录 一、测试要求 二、实现效果 三、实现代码 一、测试要求 二、实现效果 数据库中的内容 使用数据库中的账号登录 若不是数据库中的内容 三、实现代码 login.aspx文件   % Page LanguageC# AutoEventWireuptrue CodeBehindlogin.aspx.cs InheritsWebApplication2.login %!DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtml head runatserver meta http-equivContent-Type contenttext/html; charsetutf-8/title/titlelink relstylesheet hrefStyleSheet1.css/style typetext/css.auto-style1 {width: 97%;height: 115px;}.auto-style2 {width: 137px;}.auto-style3 {height: 33px;}/style/head bodyform idform1 runatserverdivbr /br /div idloginh1nbsp;/h1h1 classauto-style3登录/h1pnbsp;/ptable classauto-style1trtd classauto-style2用户名/tdtdasp:TextBox IDTextBox1 runatserver CssClasstxt/asp:TextBoxasp:RequiredFieldValidator IDRequiredFieldValidator1 runatserver ControlToValidateTextBox1 ErrorMessage× ForeColorRed/asp:RequiredFieldValidator/td/trtrtd classauto-style2密码/tdtdasp:TextBox IDTextBox2 runatserver CssClasstxt/asp:TextBoxasp:RequiredFieldValidator IDRequiredFieldValidator2 runatserver ControlToValidateTextBox2 ErrorMessage× ForeColorRed/asp:RequiredFieldValidator/td/tr/tablebr /br /br /br /asp:Button IDButton3 runatserver Height38px OnClickButton3_Click Text登录 Width110px /br /br /br /asp:LinkButton IDLinkButton1 runatserver OnClickLinkButton1_Click没有账号立即注册/asp:LinkButton/div/div/form /body /htmllogin.aspx.cs文件 using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration;namespace WebApplication2 {public partial class login : System.Web.UI.Page{string sqlconn ConfigurationManager.ConnectionStrings[userConnString].ToString();//建立connection链接对象这里最好设置成全局变量否则后面每次都得新建SqlConnection myconnection new SqlConnection();protected void Page_Load(object sender, EventArgs e){UnobtrusiveValidationMode UnobtrusiveValidationMode.None;myconnection.ConnectionString sqlconn;//Label1.Text myconnection.State.ToString();}//protected void Button1_Click(object sender, EventArgs e)//{// myconnection.Open();// Label1.Text myconnection.State.ToString();//}//protected void Button2_Click(object sender, EventArgs e)//{// myconnection.Close();// Label1.Text myconnection.State.ToString();//}protected void LinkButton1_Click(object sender, EventArgs e){Response.Redirect(zhuce.aspx);}protected void Button3_Click(object sender, EventArgs e){myconnection.Open();string name TextBox1.Text;string pwd TextBox2.Text;string sqlcmd select * from users where name name and pwd pwd ;SqlCommand mycommand new SqlCommand(sqlcmd, myconnection);SqlDataReader myreader mycommand.ExecuteReader();myreader.Read();if (myreader.HasRows){Response.Write(scriptalert(欢迎访问);/script);}else{Response.Write(scriptalert(账号或密码错误);/script);}myreader.Close();myconnection.Close();}} } stylesheet1.css文件 body {background-color:azure; } #login{width:600px;height:550px;border:1px solid black;background-color:white;margin:50px auto;text-align:center; } #login table{text-align:center; }.txt{height:30px;width:270px; } register.aspx文件zhuce.aspx % Page LanguageC# AutoEventWireuptrue CodeBehindzhuce.aspx.cs InheritsWebApplication2.zhuce %!DOCTYPE htmlhtml xmlnshttp://www.w3.org/1999/xhtml head runatserver meta http-equivContent-Type contenttext/html; charsetutf-8/title/titlelink hrefStyleSheet2.css relstylesheet/style typetext/css.auto-style1 {width: 95%;height: 164px;}.auto-style2 {height: 54px;}.auto-style3 {height: 54px;width: 235px;}.auto-style4 {width: 235px;}/style /head bodyform idform1 runatserverdiv idzhuceh1nbsp;/h1h1注册/h1table classauto-style1trtd classauto-style3用户名/tdtd classauto-style2asp:TextBox IDTextBox1 runatserver CssClasstxt1/asp:TextBoxasp:RequiredFieldValidator IDRequiredFieldValidator1 runatserver ControlToValidateTextBox1 ErrorMessage× ForeColorRed/asp:RequiredFieldValidator/td/trtrtd classauto-style4密码/tdtdasp:TextBox IDTextBox2 runatserver CssClasstxt1/asp:TextBoxasp:RequiredFieldValidator IDRequiredFieldValidator2 runatserver ControlToValidateTextBox2 ErrorMessage× ForeColor#FF3300/asp:RequiredFieldValidator/td/trtrtd classauto-style4确认密码/tdtdasp:TextBox IDTextBox3 runatserver CssClasstxt1/asp:TextBoxasp:CompareValidator IDCompareValidator1 runatserver ControlToCompareTextBox2 ControlToValidateTextBox3 ErrorMessage× ForeColorRed/asp:CompareValidator/td/tr/tablebr /br /asp:Button IDButton1 runatserver Height46px OnClickButton1_Click Text注册 Width133px /br /br /br /asp:LinkButton IDLinkButton1 runatserver OnClickLinkButton1_Click已有帐号立即登录/asp:LinkButtonbr /br /br /br /br /br //div/form /body /htmlregister.aspx.cs文件(zhuce.aspx.cs) using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data; using System.Data.SqlClient; using System.Configuration;namespace WebApplication2 {public partial class zhuce : System.Web.UI.Page{string sqlconn ConfigurationManager.ConnectionStrings[userConnString].ToString();//建立connection链接对象这里最好设置成全局变量否则后面每次都得新建SqlConnection myconnection new SqlConnection();protected void Page_Load(object sender, EventArgs e){UnobtrusiveValidationMode UnobtrusiveValidationMode.None;myconnection.ConnectionString sqlconn;//Label1.Text myconnection.State.ToString();}protected void LinkButton1_Click(object sender, EventArgs e){Response.Redirect(login.aspx);}protected void Button1_Click(object sender, EventArgs e){myconnection.ConnectionString sqlconn;myconnection.Open();string name TextBox1.Text;string pwd TextBox3.Text;string sqlcmd insert into users(name,pwd) values ( name , pwd );SqlCommand mycommand new SqlCommand(sqlcmd, myconnection);mycommand.ExecuteNonQuery();Response.Write(scriptalert(添加成功);/script);myconnection.Close();}//protected void Button2_Click(object sender, EventArgs e)//{// myconnection.Open();// Label1.Text myconnection.State.ToString();//}//protected void Button3_Click(object sender, EventArgs e)//{// myconnection.Close();// Label1.Text myconnection.State.ToString();//}} } stylesheet2.css文件 body {background-color:azure; } #zhuce {width: 600px;height: 550px;border: 1px solid black;background-color: white;margin: 30px auto;text-align: center; } .txt1 {height: 30px;width: 270px; }这次的测试我觉得我完成的也是可以的首先通过配置参数将网页与数据库进行了相连然后使用一个label和两个button一个是打开数据库一个是关闭数据库来验证配置参数的正确性验证完成之后按照题目的要求设置相应的格式。 后面有时间的话再完善一下。
http://www.dnsts.com.cn/news/27287.html

相关文章:

  • 做网站如何更新百度快照个人网站可以不备案吗
  • 中国优秀的企业网站微网站风格
  • 南京网站推广价格上饶市做网站
  • 新手制作网站wordpress如何装模板
  • 杭州做网站哪家便宜网站关键词设置几个
  • 纯静态网站的用什么cms沈阳互联网公司
  • 在微信中做网站wordpress 跳过ftp
  • 辽源网站seo漳州网站建设公司
  • 葫芦岛网站网站建设外贸海外网站推广
  • wordpress建站详细教程wordpress 和dokuwiki
  • 潍坊 网站建设网站建设人员的安排
  • 网站开发做表格示例天津网站建设天津
  • 织梦网站怎么做301房屋设计软件免费下载
  • 高质量的高密网站建设杭州优化公司排行榜
  • 做农药的网站wordpress35
  • 用php做的网站论文贵州城乡建设厅施工员报名网站
  • 建设网站需要多少人做网站然后卖
  • 网站建设去哪可接单单县网站定制
  • 网站使用网络图片做素材 侵权吗做网站投入
  • 做直播网站一定要idc吗网站建设app销售好做吗
  • 合肥模板建站多少钱做网站设计比较好的公司
  • 网站建设业务员前景物联网解决方案
  • 上饶做网站哪家好哦个人卖货入驻什么平台
  • 网站海外推广资源学术网站建设
  • 梅河口建设局网站腾讯免费网站建设
  • 基于中小企业需求的电子商务网站建设营销式网站制作
  • 怎么做可以聊天的网站电话怎么做网站域名
  • 网站尺寸国内软件上市公司排行榜
  • 网站设计的销售网站建设合同拟写
  • 郑州网站设计专家wordpress广告主题