1. 急!vs2005(C#)用戶登錄連接資料庫的源代碼
這是一個實例 有不懂的問我
{
string QuerySql = "select * from tTea where tTea_name ='" + username.Text + "' and tTea_pwd='" + pwd.Text + "'";
bool flag = DB.Query(QuerySql);
if (flag)
{
string ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
string Editsql = "insert into tAdminLog(tAdmin_name,tAdminLog_time,tAdminLog_ip,tAdminLog_zhuangtai) values('" + username.Text + "','" + DateTime.Now + "','" + ip + "','成功')";
bool flag1 = DB.Edit(Editsql);
Session["username"] = username.Text.Trim();
SqlConnection con = DB.CreatConnection();
con.Open();
SqlCommand cmd = new SqlCommand("select * from tTea where tTea_name ='" + username.Text + "'", con);
SqlDataAdapter sdr = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
sdr.Fill(ds);
Session["xueyuan"] = ds.Tables[0].Rows[0]["tTea_xueyuan"].ToString();
bool fuzheren = (bool)ds.Tables[0].Rows[0]["fuzeren"];
if (fuzheren)
{
Response.Redirect("shangji/Default.aspx");
}
else
{
Response.Redirect("teacher/Default.aspx");
}
}
else
{
string ip = System.Web.HttpContext.Current.Request.UserHostAddress.ToString();
string Editsql = "insert into tAdminLog(tAdmin_name,tAdminLog_time,tAdminLog_ip,tAdminLog_zhuangtai) values('" + username.Text + "','" + DateTime.Now + "','" + ip + "','失敗')";
bool flag1 = DB.Edit(Editsql);
Response.Write("<script>alert('用戶名或密碼錯誤?');location.href('Default.aspx')</script>");
}
}
2. 什麼是源碼的資料庫,在網上下載的源碼的資料庫是什麼
資料庫並不是都一樣
資料庫不是源碼的,而是可以獨立使用的
資料庫分access mysql mssql 等等常見的幾種
怎麼連接需要看你的程序 需要什麼庫
不同的庫有不同的鏈接
一般程序代碼中都寫好了代碼 你只需要修改資料庫的賬戶密碼
為你自己的密碼信息就可以了
這個只有你知道
或者你告訴別人登錄查詢
3. php網站源碼的資料庫賬號密碼修改問題希望高手幫解決,急
第一步:電腦win7系統,按Windows鍵+R輸入cmd 【回車】。
第二部: mysql -h地址 -uroot -p 【回車】
第三部:輸入密碼 【回車】
第四部:SET PASSWORD = PASSWROD('新密碼'); {修改密碼,後面有分號哦}
4. 有網站源碼+SQL資料庫,怎麼重置或查看後台用戶密碼。
首先你得獲取到資料庫,如果資料庫本身就是附帶在站點中的更好,然後你要找到並確定網站管理用戶表中賬戶和密碼使用的加密規則,並且使用相同的加密規則加密你的用戶名或密碼,手動添加的方式在用戶表中創建一條新條目,在網站後台就可以使用你的用戶登錄了
5. 源碼資料庫賬號密碼在哪看
在網站目錄下的文件里
一般帳號為:admin密碼:admin或者:admin888。或者網站目錄下的說明文件看看。看是什麼資料庫,ACCESS的,直接打開查看用戶名和密碼。密碼可能是MD5加密的,找到在線解密的網站如:md5.com.cn試試。
6. 你有一個簡單的資料庫的源代碼嗎最好用java實現的...
class ConnectionProvider{
private static String JDBC_DRIVER;
private static String DB_URL;
private static String DB_USER;
private static String DB_PASSWORD;
public ConnectionProvider()
{
JDBC_DRIVER = "com.mysql.jdbc.Driver"
DB_URL = "jdbc:mysql://localhost:3306/u-disk";
DB_USER = "root";
DB_PASSWORD = "root"
};
public Connection getConnection()
{
try {
Class.forName(JDBC_DRIVER);
} catch (Exception e) {
System.out.println("驅動文件路徑有誤!");
}
}
Connection con = null;
try {
con = DriverManager.getConnection(DB_URL, DB_USER,
DB_PASSWORD);
} catch (SQLException e) {
System.out.println("資料庫連接建立異常!\n@shy2850@" + e.getMessage() +
e.getCause());
}
System.out.println("得到連接:Connection " + ConnectionPool.connections.size() + 1);
return new ConnectionImpl(con);
}
}
可以使用這個包裝的資料庫連接數據源在DAO工具類中使用:
package com.jdbc;
import java.sql.*;
/**課題:封裝資料庫的增刪改查的工具類的實現。
*
* 假設相關資料庫的表結構如下:
* 表名:user
* 列名及屬性:id(int 自增),name(varchar(20)),tele(char(12)),birthday(date)
* @author shy2850
*/
public class UserDAO {
Connection conn;
public UserDAO(Connection conn) {
this.conn = conn;
}
public int save(User user) throws SQLException {
String sql = "insert into user values(0,?,?,?)";
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(1, user.getName());
pstmt.setString(2, user.getTele());
pstmt.setDate(3, user.getBirthday());
int n = pstmt.executeUpdate();
pstmt.close();
return n;
}
public int delete(User user) throws SQLException{
String sql = "delete from user where id = "+user.getId();
Statement stmt = conn.createStatement();
int n = stmt.executeUpdate(sql);
stmt.close();
return n;
}
public int update(User user) throws SQLException{
String sql = "update user set name=?, tele=?, birthday=? where id = "+user.getId();
PreparedStatement pstmt = conn.prepareStatement(sql);
pstmt.setString(2, user.getName());
pstmt.setString(3, user.getTele());
pstmt.setDate(4, user.getBirthday());
int n = pstmt.executeUpdate(sql);
pstmt.close();
return n;
}
public User getUser(Integer id) throws SQLException{
String sql = "select * from user where id = " + id;
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(sql);
User user = getUserFromResultSet(rs);
rs.close();
stmt.close();
return user;
}
static User getUserFromResultSet(ResultSet rs) throws SQLException{
Integer id = rs.getInt("id");
String name= rs.getString("name");
String tele= rs.getString("tele");
Date birthday = rs.getDate("birthday");
return new User(id, name, tele, birthday);
}
}
/**
* 構建資料庫表的java類映射
*/
class User{
private Integer id;
private String name;
private String tele;
private Date birthday;
public User() {
}
public User(Integer id, String name, String tele, Date birthday) {
super();
this.id = id;
this.name = name;
this.tele = tele;
this.birthday = birthday;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTele() {
return tele;
}
public void setTele(String tele) {
this.tele = tele;
}
public Date getBirthday() {
return birthday;
}
public void setBirthday(Date birthday) {
this.birthday = birthday;
}
}
7. 如何找到網站源碼中的資料庫
網站環境不同,不同程序有不同的資料庫配置位置以discuz為例,其他的隨機應變:
Discuz論壇的資料庫在程序中有設置文件對應查詢賬號密碼,目錄位置:
/config/config_global.php
/uc_server/data/config.inc.php
/config/config_ucenter.php
文件都含有Discuz論壇資料庫的登錄賬號密碼信息,可以參考查詢資料庫信息。
網站本身的資料庫是和程序分開的,大部分主機都是儲存在兩個空間。小型虛擬主機,沒有許可權查看資料庫文件,但是會提供在線管理的工具,一般在空間後台有提供鏈接。
雲主機,快雲VPS,雲伺服器,以及獨立主機,都有遠程伺服器管理許可權的,直接登錄遠程,就可以查看資料庫位置。
目前的情況看,快雲VPS都自帶雲資料庫,也有管理平台,可以後台直接打開,登錄管理資料庫。
8. 源碼資料庫是什麼
源碼資料庫應該是為了實現版本控制目的而設計的。
通過這個資料庫,團隊成員可以保持各自代碼為最新,同時保證成員間的代碼交流,保證團隊開發效率。