文章分类 -  ASP.NET

摘要:有很多Web程序中第一次登录后,在一定时间内(如2个小时)再次访问同一个Web程序时就无需再次登录,而是直接进入程序的主界面(仅限于本机)。实现这个功能关键就是服务端要识别客户的身份。而用Cookie是最简单的身从验证。 如果用户第一次登录,可以将用户名作为Cookie写到本地,代码如下: Code highlighting produced by Actipro CodeHighlight... 阅读全文
posted @ 2008-07-18 21:59 melody&bobo 阅读(1059) 评论(1) 推荐(1)
摘要:其实所谓的伪静态页面,就是指的URL重写,在ASP.NET中实现非常简单 首先你要在你的项目里引用两个DLL: ActionlessForm.dll URLRewriter.dll 真正实现重写的是 URLRewriter.dll 但是如果你要实现分页,那么必须使用这个ActionlessForm .dll 首先在web.conf... 阅读全文
posted @ 2008-06-26 17:21 melody&bobo 阅读(579) 评论(0) 推荐(0)
摘要:sqlhelper使用指南 阅读全文
posted @ 2008-03-22 16:04 melody&bobo 阅读(642) 评论(0) 推荐(0)
摘要:在.net 1.1中我们要实现压缩这一功能,一般都是用open source的SharpZipLib 或者调用J#类库。 现在在.net 2.0中增加了压缩功能,名字空间为 using System.IO.Compression; 压缩字符串 public static string ZipString(string unCompressedString) { ... 阅读全文
posted @ 2008-03-08 18:17 melody&bobo 阅读(172) 评论(0) 推荐(0)
摘要:ASP.NET(C#)利用QQ的IP数据库QQWry.Dat进行精确IP查询 先下载最新的IP数据库QQWry.Dat 下载IPLocation.dll 地址:http://www.iwcn.net/attachments/month_0612/g200612161210.rar 在项目中添加引用,引用IPLocation.dll 添加引用:using IPLocati... 阅读全文
posted @ 2008-03-01 10:55 melody&bobo 阅读(586) 评论(0) 推荐(0)
摘要://获取客户端的ip地址 public string GetClientIP() { string result = HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; if (null == result || result == String.Empty) ... 阅读全文
posted @ 2008-03-01 09:30 melody&bobo 阅读(187) 评论(0) 推荐(0)