System.Web.HttpContext.Current.Request.Cookies["UserID"].Value
解决方案 »
- 智能提示+模糊查找的Dropdowlist源码或组件
- |zyciis| 如何让VS2005发布网站的时候生成的DLL是一个而不是一大堆
- [有兴趣看看]BingMap Control 加载google混合地图
- 请问,打开一个网上下载的ASP。NET程序,为什么不能运行?
- 救命啊~~~过了这关 俺的毕计就基本结束了~~感觉代码写的都对着来 可就是有问题 高手帮帮了
- 高手请帮忙~~~~~~~~~这样的SQL怎么写??急
- Invalid_Viewstate_Client_Disconnected错误
- 安装.net Framwork后,仍然识别不了.aspx文件,为什么?
- ajax+asp.net实现网页版的网络通信问题
- 参数化查询 '(@Name nvarchar(4000),@Age nvarchar(4000))insert into 姓名年龄(Name,' 需要参数 '@
- 自定义控件中按钮事件为何不触发?
- 怎么才能让datagrid单元格内的数据不换行?
try{
uid = Request.Cookies["UserID"].Value;
}
catch{
uid = "";
}
{
bool logintrue;
string user_id,password;
if(!Page.IsPostBack)
{
user_id=Request.Form["user_id"];
password=Request.Form["password"];
bbsname.Text=con.bbsname;
if(user_id!=null&&password!=null)
{
con.open();
logintrue=con.checklogin(user_id,password);
con.link.Close();
if(logintrue)
{
Response.Redirect("index.aspx");
}
else
{
wc.Visible=true;
wc.InnerHtml="用户名或口令不对";
}
}
}
} protected void login(Object sender, EventArgs e)
{
bool logintrue;
con.open();
logintrue=con.checklogin(user_id.Text,password.Text);
con.link.Close();
if(logintrue)
{
string savedate=savepassword.SelectedItem.Value;
if(Int32.Parse(savedate)>0)
{
HttpCookie cookie=new HttpCookie("aspx");
cookie["user_id"]=user_id.Text;
cookie["savepassword"]=savedate;
cookie["password"]=password.Text;;
cookie.Expires=DateTime.Now.AddDays(Int32.Parse(savedate));
Response.Cookies.Add(cookie);
}
Response.Redirect("index.aspx");
}
else
{
wc.Visible=true;
wc.InnerHtml="用户名或口令不对";
}
}
!??呵呵
!??呵呵
----------------
hehe!
有很多地方与asp不一样,
我刚开始的时候也总是犯这种错误,
习惯就好了,
其实.net比asp好多了。