LINQ重写博客垃圾图片回收算法
思路很简单,从所有Blog Model中解析出所有文章使用的图片文件名,排除站外引用,放入一个List usedPicList。再遍历图片上传文件夹,把所有图片文件的结果加入FileInfo[] fiAllPicList。然后比较usedPicList和fiAllPicList,找出所有fiAllP
思路很简单,从所有Blog Model中解析出所有文章使用的图片文件名,排除站外引用,放入一个List usedPicList。再遍历图片上传文件夹,把所有图片文件的结果加入FileInfo[] fiAllPicList。然后比较usedPicList和fiAllPicList,找出所有fiAllP
效果图:实现代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; u
题目: 实现代码如下: try{ var me = Man({ fullname: "小红" }); var she = new Man({ fullname: "小红" }); console.group(); console.info("我的名字是:" + me.attr("fullname")
1.使用winapi “SetParent” 接口: 实现代码如下: [DllImport("user32.dll", SetLastError = true)] static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParen
在winform端,树状菜单是非常有用的,实现这个是非常便捷的,所以我想到在页面放入一个树状菜单的。我选择了dtree这个工具,网络上还有很多方法实现页面树状菜单的,不过我觉得这个比较好用的,而且配置比较简单,运用上上手很快。dtree是纯js的,所以不用导入jar包,并且配置只要在js内配置就好了
实现代码如下: 先在本机测试,在php.ini中去掉了extension=php_curl.dll前面的;,查看一下phpinfo(),并没有curl。 查了下文档, 实现代码如下: Note to Win32 Users: In order to enable this module on a W
在php程序中运用fopen或者socket的时候,报一下错误: php_network_getaddresses: getaddrinfo failed: Temporary failure in name。 我的代码如下 $handle = fopen(“http://www.baidu.com
实现代码如下: //重新封装document对象 var Console={ Write:function(msg){alert(msg);} }; //Person对象 var Person={ _name:"zzl", //static public _age:28, PrintInfo:fun
之后看phpinfo() 里 确实也没找到mysql 模块, 之后所谓的解决方案如“将php.ini” 放入C:\Windows 环境变量等不靠谱说法。。。。。 甚至拷贝ext的文件夹的dll 到System32 中等 统统不靠谱 直到看到这篇帖子,我才发现问题 http://www.haosblo
第一类方法是利用数组完成的。先把文件名切割成数组,然后想办法取得数组最后一个元素就OK了。第二类方法是通过字符串的处理来完成,还有一种方法是用pathinfo()函数。 实现代码如下: $pic = 'abc.3434.342.12123.123.exe'; $pics = explode('.'