当前位置: 代码迷 >> Sql Server >> 怎么在数据库中查找用户登陆ID与密码(ERP登陆)
  详细解决方案

怎么在数据库中查找用户登陆ID与密码(ERP登陆)

热度:76   发布时间:2016-04-24 10:27:20.0
如何在数据库中查找用户登陆ID与密码(ERP登陆)
我是初学者, 我有个小数据库,我用select 查看了每个表,怎么就查不到用户登ID与密码,要怎么查?请指教,谢谢!
------解决方案--------------------
连接数据的用户名和密码查不到的。除非自己定义到表中去。
------解决方案--------------------
看ERP系统的数据字典,找到对应的表.

------解决方案--------------------

------解决方案--------------------
开个Profiler跟踪一下你的登录语句,不过估计你连Profiler都不知道是什么。。。在百度里面搜:sql server Profiler 
------解决方案--------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;


namespace tushuguanli
{
    public partial class login : System.Web.UI.Page
    {
        DBClass dbObj = new DBClass();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("zhuce.aspx");
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (DropDownList1.SelectedIndex.ToString() == "0")
            {
                Response.Write(@"<script language = 'javascript'>alert('请选择身份!');</script");
            }
            else
            {
                Session["flag"] = DropDownList1.SelectedValue;
                string user = TextBox1.Text.Trim();
                string password = TextBox2.Text.Trim();
                string flag = DropDownList1.SelectedValue.ToString();
                Session["UID"] = aa(user, password, flag);
                int roomId = Convert.ToInt32(Session["UID"]);
                if (roomId > 0)
                {
                    Session["user"] = user;
                    Session["pas"] = password;
                    Response.Redirect("main.aspx");
                }
                else
                {
                    Response.Write(@"<script language = 'javascript'>alert('用户名或密码不正确');</script");
                }
            }
        }
        protected string aa(string UName, string Upwd, string Ustate)
        {
            string UID = "0";
            //SqlConnection cn = new SqlConnection("server=.;database=demo;user=sa;pwd=123");
            SqlConnection cn = dbObj.GetConnection();
            string sql = "select UID from userinfo where UName = '" + UName + "'and Upwd='" + Upwd + "'and Ustate='" + Ustate + "'";
  相关解决方案