<html>
<script language="C#" runat="server"> void Page_Load(Object sender, EventArgs E) {
if (Request.Cookies["preferences1"] == null) {
HttpCookie cookie = new HttpCookie("preferences1");
cookie.Values.Add("ForeColor","black");
cookie.Values.Add("BackColor","beige");
cookie.Values.Add("LinkColor","blue");
cookie.Values.Add("FontSize","8pt");
cookie.Values.Add("FontName","Verdana");
Response.AppendCookie(cookie);
}
} protected String GetStyle(String key) {
HttpCookie cookie = Request.Cookies["preferences1"];
if (cookie != null) {
switch (key) {
case "ForeColor" :
return cookie.Values["ForeColor"];
break;
case "BackColor" :
return cookie.Values["BackColor"];
break;
case "LinkColor" :
return cookie.Values["LinkColor"];
break;
case "FontSize" :
return cookie.Values["FontSize"];
break;
case "FontName" :
return cookie.Values["FontName"];
break;
}
}
return "";
} </script> <style> body {
font: <%=GetStyle("FontSize")%> <%=GetStyle("FontName")%>;
background-color: <%=GetStyle("BackColor")%>;
} a { color: <%=GetStyle("LinkColor")%> } </style> <body style="color:<%=GetStyle("ForeColor")%>"> <h3><font face="宋体">在客户端 Cookie 中存储易失数据</font></h3> <b><a href="customize.aspx">自定义此页</a></b><p> 设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br> </body>
</html>
<script language="C#" runat="server"> void Page_Load(Object sender, EventArgs E) {
if (Request.Cookies["preferences1"] == null) {
HttpCookie cookie = new HttpCookie("preferences1");
cookie.Values.Add("ForeColor","black");
cookie.Values.Add("BackColor","beige");
cookie.Values.Add("LinkColor","blue");
cookie.Values.Add("FontSize","8pt");
cookie.Values.Add("FontName","Verdana");
Response.AppendCookie(cookie);
}
} protected String GetStyle(String key) {
HttpCookie cookie = Request.Cookies["preferences1"];
if (cookie != null) {
switch (key) {
case "ForeColor" :
return cookie.Values["ForeColor"];
break;
case "BackColor" :
return cookie.Values["BackColor"];
break;
case "LinkColor" :
return cookie.Values["LinkColor"];
break;
case "FontSize" :
return cookie.Values["FontSize"];
break;
case "FontName" :
return cookie.Values["FontName"];
break;
}
}
return "";
} </script> <style> body {
font: <%=GetStyle("FontSize")%> <%=GetStyle("FontName")%>;
background-color: <%=GetStyle("BackColor")%>;
} a { color: <%=GetStyle("LinkColor")%> } </style> <body style="color:<%=GetStyle("ForeColor")%>"> <h3><font face="宋体">在客户端 Cookie 中存储易失数据</font></h3> <b><a href="customize.aspx">自定义此页</a></b><p> 设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br>
设想这里有某些内容 ...<br> </body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货