摘要: /// <summary> /// 将指定字符串按指定长度进行剪切, /// </summary> /// <param name= "oldStr "> 需要截断的字符串 </param> /// <param name= "maxLength "> 字符串的最大长度 </param> /// <param name= "endWith "> 超过长度的后缀 </param> /// <returns> 如果超过长度,返回截断 阅读全文
posted @ 2011-05-13 13:25 小2010 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 比较万能的分页 SQL语句select top 每页显示的记录数 * from topic where id not in (select top (当前的页数-1)×每页显示的记录数 id from topic order by id desc) order by id desc 需要注意的是在access中不能是top 0,所以如果数据只有一页的话就得做判断了。。 SQL2005中的分页代码: with temptbl as ( SELECT ROW_NUMBER() OVER (ORDER BY id desc)AS Row, ... ) SELECT * FROM tempt 阅读全文
posted @ 2011-05-13 13:24 小2010 阅读(185) 评论(0) 推荐(0) 编辑
摘要: ① 导入命名空间 using System.Web.Security; ② 获取MD5码:string Password = FormsAuthentication.HashPasswordForStoringInConfigFile(TextBox1.Text.ToString(), "MD5"); 阅读全文
posted @ 2011-05-13 13:17 小2010 阅读(79) 评论(0) 推荐(0) 编辑
摘要: Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('加入暂存架成功!');</script>"); 类似于AJAX的效果,页面不刷新!!! 阅读全文
posted @ 2011-05-13 13:16 小2010 阅读(78) 评论(0) 推荐(0) 编辑
摘要: 新建“一般处理程序”HTML 代码ASP.NET用一般处理程序生成验证码 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <script type="text/javasc 阅读全文
posted @ 2011-05-13 13:14 小2010 阅读(237) 评论(0) 推荐(0) 编辑
摘要: asp.net调用存储过程 存储过程如下CREATE procedure Pr_AddFile @FileName varchar(100), @FileUrl varchar(200), @FileKind varchar(100)ASDeclare @RecordCount as int SET @RecordCount=(select count(*) FROM File1 WHERE FileName=@FileName)IF @RecordCount<1 BEGIN INSERT INTO File1([FileName],FileUrl,FileKind) VALUES (@ 阅读全文
posted @ 2011-05-13 00:23 小2010 阅读(187) 评论(0) 推荐(0) 编辑