江大鱼(江振宇)的BLOG

不求大作,只为记录点点滴滴(转载本人原创文章转载请注明出处)

  博客园 :: 首页 :: 联系 :: 订阅 订阅 :: 管理

.Net Framework

     摘要: 博客园已有几位同学发表了关于FileSystemWatcher事件多次触发的解决方法的文章,很好地解决了事件多次激发的问题。 主要方法有: 1.延迟激发法。 http://www.cnblogs.com/dragon/archive/2008/07/04/filesystemwatcher.html 原理是延迟调用事件的代理,将多次事件合并为一次,从而很好的解决了此问题,唯一的缺憾是时间激发不及时,不适用于实时性较高的系统。 2.临时禁用法. 3.检查最后更新时间法.  阅读全文
posted @ 2008-07-23 21:55 江大鱼 阅读(110) | 评论 (0)  编辑

     摘要: The class System.Convert provide two basic methods "ToBase64String()" and "Convert.FromBase64String()" to encode a byte array to a base64 string and decode a base64 string to a byte array. It is very good to use them to encode and decode base64. But in some case, it is a disaster. For example, if you want to encode a 4 gb file to base64, the code above must throw an OutOfMemory exception., because you must read the file into a byte array. So we need to look for another way to e  阅读全文
posted @ 2008-04-20 21:48 江大鱼 阅读(284) | 评论 (0)  编辑

     摘要: 在.net 1.1中我们要实现压缩这一功能,一般都是用open source的SharpZipLib 或者调用J#类库。 现在在.net 2.0中增加了压缩功能,名字空间为 using System.IO.Compression;  阅读全文
posted @ 2006-05-23 16:23 江大鱼 阅读(782) | 评论 (0)  编辑