



下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、using System;using System.Data;using System.Configuration;using System.Web;usingusingusingusingusingusingpublic partial class _DefaultPage protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) string Con = "Data Source=localhost;User Id=sa
2、;Password=;Initial Catalog=db_lyb" SqlConnection sqlcon = new SqlConnection(Con); sqlcon.Open(); SqlCommand sqlcom2 = new SqlCommand(); sqlcom2.Connection=sqlcon; sqlcom2.CommandText = "select * from tb_user where Uid='"+TextBox1.Text+"'" SqlDataReader read = sqlcom2
3、.ExecuteReader(); read.Read(); if (read.HasRows) Response.Write("<script language=javascript>alert('对不起,该用户已经注册!')</script>"); return; read.Close(); try SqlCommand sqlcom = new SqlCommand(); sqlcom.Connection = sqlcon; sqlcom.CommandText = "Insert into tb_user valu
4、es('" + TextBox1.Text + "','" + TextBox2.Text + "')" sqlcom.ExecuteNonQuery(); Response.Write("<script language=javascript>alert('注册成功!');location='Default2.aspx'</script>"); catch (Exception ex) Response.Write("<
5、script language=javascript>alert('注册失败!')</script>"); sqlcon.Close(); using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;usingusingusingusingusingusingpublic partial class Default2Page protected void Page_Load(object sender, Even
6、tArgs e) protected void Button1_Click(object sender, EventArgs e) string Con = "Data Source=localhost;User Id=sa;Password=;Initial Catalog=db_lyb" SqlConnection sqlcon = new SqlConnection(Con); sqlcon.Open(); SqlCommand sqlcom = new SqlCommand(); SqlCommand sqlcom2 = new SqlCommand(); sqlc
7、om2.Connection = sqlcon; sqlcom2.CommandText = "select * from tb_user where Uid='" + TextBox1.Text + "' and Pwd='"+TextBox2.Text+"'" SqlDataReader read = sqlcom2.ExecuteReader(); read.Read(); if (read.HasRows) Response.Write("<script language=jav
8、ascript>location='Default3.aspx'</script>"); return; else Response.Write("<script language=javascript>alert('用户名或密码错误')</script>"); read.Close(); using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;us
9、ingusingusingusingusingusingpublic partial class Default3Page protected void Page_Load(object sender, EventArgs e) protected void Button1_Click(object sender, EventArgs e) string Con = "Data Source=localhost;User Id=sa;Password=;Initial Catalog=db_lyb" SqlConnection sqlcon = new SqlConnect
10、ion(Con); sqlcon.Open(); try SqlCommand sqlcom = new SqlCommand(); sqlcom.Connection = sqlcon; sqlcom.CommandText = "Insert into tb_fb values('" + TextBox1.Text + "','" + TextBox2.Text + "')" sqlcom.ExecuteNonQuery(); Response.Write("<script language=javascript>alert('留言发表成功');location='Default2.aspx'&l
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 出纳实务网课试题及答案
- 初级财务考试题库及答案
- 动态广告设计的创作试题及答案
- 全面掌握国际商业美术设计师考试试题及答案原则
- 餐饮hr面试题目及答案
- 2024年纺织品检验员考试挑战试题及答案
- 2024年助理广告师考试细节注意试题及答案
- 2024广告设计师考试常见误区分析试题及答案
- 安全监理考核试题及答案
- 商业美术设计师创意资源利用试题及答案
- 素养为本的教学评一体化教学设计核心理念
- 译林版三年级上册英语书单词表
- 康复科并发症二次残疾
- (新版)拖拉机驾驶证科目一知识考试题库500题(含答案)
- 2025年中考物理一轮复习:物理学与社会发展 专项练习
- DL∕T 526-2013 备用电源自动投入装置技术条件
- 2024年北京大兴区九年级初三一模英语试题和答案
- 食品生物化学 知到智慧树网课答案
- 2024年江苏国信新丰海上风力发电有限公司招聘笔试冲刺题(带答案解析)
- 学术交流英语(学术写作)智慧树知到期末考试答案2024年
- 国家卫生部《综合医院分级管理标准》
评论
0/150
提交评论