http://192.168.0.118/reportprint/Default.aspx?UserID=djhadmin&Pwd=admin&Select1=2011
这样为啥登陆不进系统啊 .net 完全没有反应 ,不知道为啥??

解决方案 »

  1.   

    <form method="post" 一般应该是 post 
      

  2.   

    aspx  的 是不是不能这样进系统 啊 
      

  3.   

    这个不大可能了,登录的时候,用户名密码要和数据库匹配的,不过你可以在登录进去后的页面的url显示
      

  4.   

    提交方式可能不对  或者 在其他页面没有接受到你URL传过去的参数
      

  5.   

    这是页面的代码<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default"  %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
        <link href="Styles/StyleSheet.css" type="text/css"  rel="stylesheet"/>
        <style type="text/css">

    body {
    background-color: #41464C;
    }
    -->
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body leftmargin="0" topmargin="0" scroll="no" style="border:0px;">
        <form id="form1" runat="server"> <table width="1000" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#040404" valign="middle">
      <tr>
        <td align="left" valign="middle">
          <table width="1000"  border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td align="left"> 
    <table width="100%" height="215" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td background="images/sino_01.gif"></td>
      </tr>
    </table>
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="508" align="left"><img src="images/sino_02.gif" alt="logo" width="508" height="194" /></td>
        <td width="314" align="left" valign="top"><table width="341" height="160" border="0" align="left" cellpadding="0" cellspacing="0">
          <tr>
            <td width="314" height="43" background="images/denglu_03.gif">&nbsp;</td>
          </tr>
          <tr>
            <td height="108" valign="bottom" background="images/denglu_05.gif"><table width="314" height="100" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td width="24%" rowspan="4">&nbsp;</td>
                <td width="76%" height="22"><span class="bt">&nbsp; 用户名:</span>
                    <input id="UserID"  type="text" runat="server" class="logins" maxlength="20" style="height:auto"/></td>
              </tr>
              <tr>
                <td style="height: 22px"><span class="bt">&nbsp; 密&nbsp; 码:</span>
                    <input id="Pwd" maxlength="20"  type="password"  runat="server" class="logins" style="height:auto" /></td>
              </tr>
              <tr>
                <td height="22"><span class="bt">数据年份:</span>
                    <select id="Select1" style="width: 60px;height:auto" runat="server" name="select" class="logins">
                    </select>            </td>
              </tr>
              <tr>
                <td height="30" valign="bottom"> &nbsp;<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/sino_14.gif" OnClick="ImageButton1_Click1" />
                    &nbsp; &nbsp; &nbsp;&nbsp;
                    <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/Images/sino_16.gif"
                        OnClick="ImageButton2_Click1" /></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td height="43" background="images/denglu_06.gif">&nbsp;</td>
          </tr>
        </table></td>
        <td background="images/sino_04.gif">&nbsp;</td>
      </tr>
    </table>
    <table width="100%" height="214" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top" background="images/sino_19.gif"><table width="350" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td height="23"></td>
          </tr>
          <tr>
            <td height="60" align="center" valign="top">
    <span class="text_A_w">版权所有&copy;&nbsp</span></td>
          </tr>
        </table></td>
      </tr>
    </table>
       </td>
      </tr>
    </table> 
    </td>
      </tr>
    </table>
     
        </form>
    </body>
    </html>
      

  6.   

    你的login页面
    string url = "receive.aspx?id="+txtId.Text+"&name="+txtName.Text+"";
    Response.Redirect(url);在receive页面的地址栏就会显示
    你要获取值的话就:request.QueryString["id"]...
      

  7.   

    这是验证的方法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;public partial class _Default : System.Web.UI.Page 
    {
        DB db = new DB();
        CheckOther chk = new CheckOther();
        BasePage bp = new BasePage();    protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string selectYear = "SELECT distinct sta_year FROM FundStateData where sta_year<>'' order by sta_year desc";
                DataSet ds = db.dbSelect(selectYear);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                    {
                        //if (db.IFHasRow("FundStateData", "sta_year", Convert.ToString(int.Parse(ds.Tables[0].Rows[i][0].ToString()) - 2)) == 1 && db.IFHasRow("FundStateData", "sta_year", Convert.ToString(int.Parse(ds.Tables[0].Rows[i][0].ToString()) - 1)) == 1)
                        //{
                            this.Select1.Items.Add(ds.Tables[0].Rows[i][0].ToString());
                            if (ds.Tables[0].Rows[i][0].ToString() == DateTime.Now.Year.ToString())
                            {
                                this.Select1.Value = DateTime.Now.Year.ToString();
                            }
                        //}
                    }
                }
            }
        }
       
        protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
        {
            try
            {
                string userID = this.UserID.Value.ToString();
                string password = this.Pwd.Value.ToString();
                if (userID == "")
                {
                    BasePage.MessageBox.Show("用户名不能为空!");
                    return;
                }
                if (password == "")
                {
                    BasePage.MessageBox.Show("密码不能为空!");
                    return;
                }
                if (chk.CheckUserLogin(userID, password))
                {
                    Session["Login"] = "Yes";
                    Session["UserID"] = userID;
                    //Session["id"] = "100000";
                    string selectName = "SELECT * FROM admin_user WHERE admin_name='" + userID + "'";
                    DataSet dsname = db.dbSelect(selectName);
                    Session["UserName"] = dsname.Tables[0].Rows[0]["admin_truename"].ToString();
                    Session["admin_login"] = dsname.Tables[0].Rows[0]["admin_name"].ToString();
                    Session["group_id"] = dsname.Tables[0].Rows[0]["group_id"].ToString();
                    Session["admin_id"] = dsname.Tables[0].Rows[0]["admin_id"].ToString();
                    System.Net.IPAddress addr = new System.Net.IPAddress(System.Net.Dns.GetHostByName(System.Net.Dns.GetHostName()).AddressList[0].Address);
                    string upSql = string.Format("update admin_user set admin_lastlogin='{0}',admin_logins = admin_logins+1,admin_ip='{1}' where admin_name='{2}'", DateTime.Now, addr, userID);
                    db.dbExcuteCmdText(upSql);
                    Response.Redirect("Main.aspx", false);
                    int aaa;
                    aaa = int.Parse(this.Select1.Items[this.Select1.SelectedIndex].Text.ToString());
                    string insertYear = "UPDATE    SetSysYear SET SysYear = '" + aaa.ToString() + "' ";
                    db.dbExcuteCmdText(insertYear);
                    return;
                }
                else
                {
                    BasePage.MessageBox.Show("用户名或密码不正确!");
                    return;
                }
            }
            catch (Exception ex)
            {
                BasePage.TurnError.Redirect(ex);
            }
        }
        
        protected void ImageButton2_Click1(object sender, ImageClickEventArgs e)
        {
            this.UserID.Value = "";
            this.Pwd.Value = "";
            this.Select1.SelectedIndex = 0;
        }
    }
      

  8.   

    你把request的参数在pageload里面
    验证登陆之前输出一下看看
      

  9.   

    额 LZ你没有设置提交方式啊  一般是POST 你获取参数那这样写试试
    request.Params[".."]
    其实LZ可以用session 没必要把参数用URL传递这样不安全
      

  10.   

     http://192.168.0.118/reportprint/Default.aspx?UserID=djhadmin&Pwd=admin&Select1=2011
     用户名和年份可以传过来 ,但是 密码不能传过来 ,不知道为啥 啊 
      

  11.   

    后台接收URL传的参数你没写吧
      

  12.   

    我的目的主要是想 通过url直接登进系统 ,这是我目前的任务啊 
      

  13.   

    你在default的PageLoad里面  获取地址栏的UserID PWD  判断已经存在了  Response.Redirect(系统页面URL)
      

  14.   

    可以的 pageload里面接收下Page_Load(...)
    {
       if(!IsPostBack)
        {
             string uid=request["uid"].tostring().trim();
             string pwd=request["pwd"].tostring().trim();
             if(!checkLogin(uid,pwd))
                  response("Error.aspx");
         }
    }
      

  15.   

    在PageLoad 你们直接跳转可以 了  ,呵呵 ,不过不知道有没有问题 啊