导航

2011年4月21日

摘要: Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long说明判断指定文件的属性返回值Long,-1表示出错。如返回包含了标志的一个Long值,则指定文件的属性。其中的标志对应于带有FILE_ATTRIBUTE_???前缀的常数。具体参考BY_HANDLE_FILE_INFORMATION结构的File Attribute Types table表格参数表参数类型及说明lpFileName 阅读全文

posted @ 2011-04-21 10:26 Trible.H 阅读(1092) 评论(0) 推荐(0) 编辑

摘要: 路径截断与合并函数PathRemoveArgs去除路径的参数PathRemoveBackslash去除路径最后的反斜杠“\”PathAddBackslash在路径最后加上反斜杠“\”PathRemoveBlanks去除路径前后的空格PathAddExtension在文件路径后面加上扩展名PathRemoveExtension去除文件路径扩展名PathRenameExtension更改文件路径扩展名PathRemoveFileSpec去除文件名,得到目录PathUnquoteSpaces去除路径中的首尾空格PathQuoteSpaces判断路径中是否有空格,有的话,就是用“”引号把整个路径包含 阅读全文

posted @ 2011-04-21 10:19 Trible.H 阅读(566) 评论(0) 推荐(0) 编辑

2011年4月19日

摘要: 只能输入数字:"^[0-9]*$"。 只能输入n位的数字:"^\d{n}$"。 只能输入至少n位的数字:"^\d{n,}$"。 只能输入m~n位的数字:。"^\d{m,n}$" 只能输入零和非零开头的数字:"^(0|[1-9][0-9]*)$"。 只能输入有两位小数的正实数:"^[0-9]+(.[0-9]{2})?$"。 只能输入有1~3位小数的正实数:"^[0-9]+(.[0-9]{1,3})?$"。 只能输入非零的正整数:"^\+?[1-9] 阅读全文

posted @ 2011-04-19 18:01 Trible.H 阅读(568) 评论(0) 推荐(2) 编辑

2011年4月15日

摘要: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> New Document </title><style>img{border:0px; cursor:pointer;}</style><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/ 阅读全文

posted @ 2011-04-15 13:17 Trible.H 阅读(2553) 评论(0) 推荐(0) 编辑

摘要: 图片撑破页面,相信大家会有被困扰的时候,或许是以前,或许是现在,但不要紧了,jquery帮你两行代码就解决问题,让图片被受控制。代码如下:$(document).ready(function(){var ywidth = 500;//初始最大宽度$(”img”).each(function(){ if($(this).width() > ywidth) { $(this).width(ywidth); }});});把它加到网页上立杆见影,让图片不在头痛。有的朋友可能会想查看大图,那没问题,再加几行代码,加个点击查看大图的效果。代码如下:$(document).ready(functio 阅读全文

posted @ 2011-04-15 13:11 Trible.H 阅读(3296) 评论(0) 推荐(0) 编辑

摘要: 1. $(document).ready(function() { 2. $('a[href*=#]').click(function() {3. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,richard,'')4. && location.hostname == this.hostname) {5. var $target = $(this.hash);6. $target = $target.length && 阅读全文

posted @ 2011-04-15 11:57 Trible.H 阅读(320) 评论(0) 推荐(0) 编辑

摘要: window.location = "http://www.xxxxxxxx.net" 跳转后有后退功能其实应该是 window.location.hrefwindow.location.replace("http://www.xxxxxxxx.net") 跳转后没有后退功能window.open("http://www.xxxxxxxx.net") 要新的窗口打开链接这个一般用于简单的弹出页面,现在基本上都被屏蔽掉了window.location.reload();window.location = "/Admin/Use 阅读全文

posted @ 2011-04-15 11:22 Trible.H 阅读(32726) 评论(0) 推荐(0) 编辑

2011年4月8日

摘要: public ActionResult JavaScriptResultDemo() { return JavaScript(@"alert(""This is from Conroll!"")"); } 阅读全文

posted @ 2011-04-08 11:32 Trible.H 阅读(392) 评论(0) 推荐(0) 编辑

2011年4月7日

摘要: 设置或获取对象指定的文件名或路径。alert(window.location.pathname)设置或获取整个 URL 为字符串。alert(window.location.href);设置或获取与 URL 关联的端口号码。alert(window.location.port)设置或获取 URL 的协议部分。alert(window.location.protocol)设置或获取 href 属性中在井号“#”后面的分段。alert(window.location.hash)设置或获取 location 或 URL 的 hostname 和 port 号码。alert(window.locati 阅读全文

posted @ 2011-04-07 16:26 Trible.H 阅读(284071) 评论(2) 推荐(10) 编辑

2011年3月11日

摘要: 我们讨论上传图片不对图片做任何更改.首先图片是以字节块存入数据库的,所以我们应该在数据库中增加一列名为ImageFile,类型为varbinary.我们在做Model层,我采用的是Linq to Sql 映射表,我们在写工具类,这个工具类很简单只有一个条件查询和增加,保存,代码如下:代码 Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1usingSystem;2usingSystem.Collections.Generic;3usingSy 阅读全文

posted @ 2011-03-11 17:43 Trible.H 阅读(1755) 评论(2) 推荐(0) 编辑