Fork me on GitHub

2010年4月26日

摘要: c#中cookies的存取操作 c#中cookies的存取cookies的创建:在客户端创建一个username的cookies,其值为gjy,有效期为1天.方法1:Response.Cookies["username"].Value="zxf";Response.Cookies["username"].Expires=DateTime.Now.AddDays(1);方法2:System.Web.... 阅读全文
posted @ 2010-04-26 23:18 HackerVirus 阅读(1350) 评论(0) 推荐(0)
摘要: 我在上一篇文章中讲到了如何使用C#模拟用户登录具有验证码网站。今天我就换位思考一下,站在网站开发人员的角度讲一讲验证码的的一个安全问题:及时销毁网站中的验证码。为了方便大家理解,这里我就以一个投票的应用网站为例进行说明。投票网站首先要防止的就是用户不断点击投票按钮来重复投票;当然,避免重复投票的解决办法有很多,比如记录IP、写入Session、Cookie甚至还有要求用户输入身份证号码等。但是你记... 阅读全文
posted @ 2010-04-26 22:37 HackerVirus 阅读(525) 评论(1) 推荐(0)
摘要: 第一个方法:/* 经测试,在 14483461 条记录中查询第 100000 页,每页 10 条记录按升序和降序第一次时间均为 0.47 秒,第二次时间均为 0.43 秒,测试语法如下: exec GetRecordFromPage news,newsid,10,100000 news 为 表名, newsid 为关键字段, 使用时请先对 newsid 建立索引。*//* 函数名称: Ge... 阅读全文
posted @ 2010-04-26 22:34 HackerVirus 阅读(446) 评论(0) 推荐(0)
摘要: 首先可以传来一个strCode,这个可以用简单的脚本生成就可以了function buildImgCode() { vImgCode=Math.random().toString(10).substring(2,6); document.getElementById("imgCode").src="生成图片的页面.aspx?c="+vImgCode; }生成图片的页面:this.buildCode... 阅读全文
posted @ 2010-04-26 22:31 HackerVirus 阅读(595) 评论(0) 推荐(0)
摘要: System;using System.Collections.Generic;using System.Text;using System.Threading;using System.Drawing;using System.Drawing.Drawing2D; namespace FreeOH.Validate{ /// <summary> /// 本类用于产生随机的验证码 //... 阅读全文
posted @ 2010-04-26 22:29 HackerVirus 阅读(666) 评论(0) 推荐(0)
摘要: using System;using System.IO;using System.Web;using System.Text;using System.Drawing;using System.Drawing.Imaging;/// <summary>///Cls_PicVcode生成图片/// </summary>public class ValidateCode{ /... 阅读全文
posted @ 2010-04-26 22:27 HackerVirus 阅读(269) 评论(0) 推荐(0)
摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Security.Cryptography;using System.Collections;namespace Deking{ class DesEncryption {//默认密钥向量 private stat... 阅读全文
posted @ 2010-04-26 22:06 HackerVirus 阅读(503) 评论(0) 推荐(0)
摘要: 代码 阅读全文
posted @ 2010-04-26 21:44 HackerVirus 阅读(335) 评论(0) 推荐(0)
摘要: 下面介绍常用的加密解密方法:1.加密。   Response.Redirect("DetailInfo.aspx?id=" + Convert.ToBase64String(System.Text.Encoding.Default.GetBytes("sp10006")).Replace("+","%2B"));   2.解密。   string ID = System.Text.Encoding... 阅读全文
posted @ 2010-04-26 21:23 HackerVirus 阅读(606) 评论(0) 推荐(0)
摘要: 写这心得之前先申明一下前提条件是win2003+Microsoft Visual Studio .NET 2003+Microsoft Visual Studio 2005:在一个偶然的时机,在研究代码的时候,发现机器上asp.net 1.1网站打不开啦,到IIS里去一查,原来IIS上的asp.net version 只有2.0的啦!这事怎么回事,我现在也还没查出其原因,反正没有ASP.NET 1... 阅读全文
posted @ 2010-04-26 10:27 HackerVirus 阅读(219) 评论(0) 推荐(0)