紧急求助,小弟编写了一个站点其中靠Cookie存储值去实现网页间信息传递Cookie写法如下:
if (pwd == System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox2.Text, "SHA1").ToString())
{
HttpCookie aCookie = new HttpCookie("un");
aCookie.Value = name.ToString();
aCookie.Expires = DateTime.Now.AddDays(1);
Response.AppendCookie(aCookie);
HttpCookie aCookie2 = new HttpCookie("id");
aCookie2.Value = userid.ToString();
aCookie2.Expires = DateTime.Now.AddDays(1);
Response.AppendCookie(aCookie2);
Response.Redirect("~/car/CarDefault.aspx");
}
else
{
TextBox1.Text = null;
TextBox2.Text = null;
Response.Redirect("~/index.aspx");
}
此写法在VS2008中调试,在网页间用cookie["un"]和cookie["id"]来取值确定sqldatesource是可以的,但是将其搭建在IIS6.0上则出现问题,服务器上只开通了443和87端口,站点是https的,请高手赐教。
你出的是什么问题?还有,你的iis或IE是否启用了cookie?