我有一个 silverlight Web 应用程序,如果它选中“让我登录”复选框,我想保存用户凭据。
if (KeepMeSignedIn)
{
SetCookie("CECrd", userName, password);
}
设置cookie功能如下..
private static void SetCookie(string key, string uname, string password)
{
string cookieName = "CECrd";
string oldCookie = HtmlPage.Document.GetProperty(cookieName) as String;
DateTime expiration = DateTime.UtcNow + TimeSpan.FromDays(2000);
string cookie = String.Format("{0}={1}={2};expires={3}",key,uname, password, expiration.ToString("R"));
HtmlPage.Document.SetProperty(cookieName, cookie);
}
但我无法在浏览器中保存 cookie。请帮帮我。