關於前台註冊資訊頁面與後台資料庫連線

2021-05-22 09:08:21 字數 1827 閱讀 2408

using system;

using system.data;

using system.configuration;

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;

using system.data.sqlclient;

using system.io;

using system.collections;

using system.security.cryptography;

using system.text.regularexpressions;

public partial class _default : system.web.ui.page

/* private string md5encrypt(string str)

*/protected void check_click(object sender, eventargs e)

string usename = request["logint"];

string cmdtxt1 = "server=5ab2d5a75c66462//sqlexpress;database=student;integrated security=sspi";

sqlconnection con = new sqlconnection(cmdtxt1);

con.open();

sqlcommand scom = new sqlcommand("select count(*)  from student where usename='" + usename + "'", con);

int count = convert.toint32(scom.executescalar());

if (count > 0)

else

con.close();

}protected void button1_click(object sender, eventargs e)

if (pwt.text.length < 5)

string qq = this.qq.text.trim().tostring();

string ***=this.radiobuttonlist1.selecteditem.text.trim().tostring();

string id = textbox3.text.trim().tostring();

string cmdtxt1 = "server=5ab2d5a75c66462//sqlexpress;database=student;integrated security=sspi";

sqlconnection con = new sqlconnection(cmdtxt1);

con.open();

sqlcommand com=new sqlcommand();

com.connection=con;

com.commandtext= "insert into student(usename,pw,qq,***,peopleid) values('"+user+"','"+pwd+"','"+qq+"','"+***+"','"+id+"')";

com.executenonquery();

con.close();

response.write("");}}

前台顯示後台資料

1.2.request.querystring id 3.後台動態新增伺服器控制項到前台 第一步 在我們所在的頁面動態新增乙個容器,例如 div 並標記為伺服器型別 runat server 第二步 動態建立伺服器控制項 private string k 1 protected void btnad...

jstree 請求後台資料前台處理

注意 這個方法是一次載入所有資料,載入緩慢,如需使用懶載入需要後台處理 html js function function datahandle url,name,cb jsonarray.push arr 將每乙個根節點的資料存入陣列中 cb.call this,jsonarray 將所有資料放入...

php 後台資料庫與前台請求結合

get請求 預設 get獲取 get請求中引數值 username get username password get password echo username username.password password post請求,開啟網頁沒值 獲取 body 體中,這兩個變數的值 usernam...