小编roo*_*kie的帖子

点击退出时删除cookie

我正在使用下面的代码创建cookie,如何读取另一个页面中的txtusername值以及如何在单击注销时删除cookie(注销代码).我是编程的新手请帮助.

  string cookiestr;
            HttpCookie ck;
            tkt = new FormsAuthenticationTicket(1, txtUserName.Value, DateTime.Now,
            DateTime.Now.AddMinutes(30), chkPersistCookie.Checked, "your custom data");
            cookiestr = FormsAuthentication.Encrypt(tkt);

            ck = new HttpCookie(FormsAuthentication.FormsCookieName, cookiestr);
            if (chkPersistCookie.Checked)
                ck.Expires = tkt.Expiration;
            ck.Path = FormsAuthentication.FormsCookiePath;
            Response.Cookies.Add(ck);
Run Code Online (Sandbox Code Playgroud)

c# asp.net cookies

9
推荐指数
2
解决办法
2万
查看次数

在另一台机器上运行我的Asp.Net Web应用程序

如何在另一台机器上运行我的应用程序,我的团队成员想要在他的计算机中查看该网页.他不想安装visual studio,只是想在浏览器中看到这个网页.

我正在使用Mac书

c# asp.net iis

2
推荐指数
1
解决办法
3649
查看次数

如何根据案例表达式中的条件更新行

我在SQL查询中有一个CASE表达式.我想基于案例表达式创建一个新列作为排名,并仅更新具有登录最大日期的行.

select A.*,
  CASE          
    WHEN A.COUNT = 1        
    THEN 'rank1'  
    -- I want to give the condition here saying update the row
    -- which has the latest login date with 'rank1' .. now it is
    -- updating all the row which has count as 1
    else 'rank2' end as Rank 
from table A
Run Code Online (Sandbox Code Playgroud)

如何在上面的代码中添加一个条件,只更新计数1和最新登录日期的列与同一注册中的其他行相比?

结束表应如下所示:

count  regID   login        rank
1      221      10 april 16     rank1
1      221      9 april 16      rank2
1      221      8 april 16      rank2
1      366      8 …
Run Code Online (Sandbox Code Playgroud)

sql oracle

2
推荐指数
1
解决办法
55
查看次数

在c#中使用salt加密密码

我搜索了一些代码来做到这一点,但发现了一些预先定义的盐.我想为每个用户自动生成salt并将salt值存储在表中.谢谢我是编程新手,请帮忙

c# encryption cryptography aes password-protection

-3
推荐指数
1
解决办法
8474
查看次数

标签 统计

c# ×3

asp.net ×2

aes ×1

cookies ×1

cryptography ×1

encryption ×1

iis ×1

oracle ×1

password-protection ×1

sql ×1