关注开源代码的实际应用
在ibatis中,#Property#将会根据实际情况进行类型的转换,
$Property$直接替换为属性的值,不进行类型的处理。
例如:person.name="llz"
$name$=llz
#name#='llz'
SharpZipLib 是一个免费的Zip操作类库,可以利用它对 ZIP 等多种格式进行压缩与解压。SharpZipLib使用C#编写的,在VB.NET、C#或其他的.NET语言中都可以使用它创建Zip文件、并进行读取 和更新等操作。下载网址:http://www.icsharpcode.net/OpenSource/SharpZipLib /Download.aspx。目前的版本为0.85。
1、创建zip文件,并添加文件:
- using (ZipFile zip = ZipFile.Create(@"E:\test.zip"))
- {
- zip.BeginUpdate();
- zip.Add(@"E:\文件1.txt");
- zip.Add(@"E:\文件2.txt");
- zip.CommitUpdate();
- }
2、将文件夹压缩为文件:
(new FastZip()).CreateZip(@"E:\test.zip", @"E:\test\", true, "");
最后一个参数是使用正则表达式表示的过滤文件规则。CreateZip方法有3个重载版本,其中有目录过滤参数、文件过滤参数及用于指定是否进行子目录递归的一个bool类型的参数。
3、将文件添加到已有zip文件中:
using (ZipFile zip = new ZipFile(@"E:\test.zip"))
{
zip.BeginUpdate();
zip.Add(@"E:\test.doc");
zip.CommitUpdate();
}
4、列出zip文件中文件
using (ZipFile zip = new ZipFile(@"E:\test.zip"))
{
string list = string.Empty;
foreach (ZipEntry entry in zip)
{
list += entry.Name + "\r\n";
}
MessageBox.Show(list);
}
5、删除zip文件中的一个文件
using (ZipFile zip = new ZipFile(@"E:\test.zip"))
{
zip.BeginUpdate();
zip.Delete(@"test.doc");
zip.Delete(@"test22.txt");
zip.CommitUpdate();
}
6、解压zip文件中文件到指定目录下
(new FastZip()).ExtractZip(@"E:\test.zip", @"E:\test\", "");
7、常用类:
ZipInputStream、GZipInputStream用于解压缩Deflate、GZip格式流,ZipOutputStream、GZipOutputStream用于压缩Deflate、GZip格式流。
StreamUtil类包含了几个Stream处理辅助方法:
①、Copy(Stream, Stream, Byte[])用于从一个Stream对象中复制数据到另一Stream对象。有多个重写
②、ReadFully(Stream, Byte [])用于从Stream对象中读取所有的byte数据。有多个重写
主要特点有:
组件结构
调用方法及参数说明
is an open soure treeview control written in JavaScript.
I wrote the script for my phpXplorer system. The script is not intended to be a website menu.
Due to use of the DOM the script only works in modern browsers like MSIE > 5.0, Netscape/Mozilla/Firefox and Opera.
Without support for dead Browsers the size of the script is only 12kb and there are no browser switches inside the code.
A funny feature is that the treeview is able to define its data definition by itself.
Try to click on the node images of this little example tree with the left mouse button.
http://www.webxplorer.org/jsTree/
MicroAjax is one of the smallest and easiest AJAX libraries. Usage:
- microAjax("/resource/url", function (res) {
- alert (res);
- });
Download:trunk version (svn) minified version (841 byte)
Help:FAQ
2、jx - JavaScript Ajax Library
jx is a small toolkit for providing AJAX support in JavaScript. It has two different version - jx and jxs.
Features

subModal是用DIV弹出层实现HTML页内对话框的Javascript Library
相关资源:
http://code.google.com/p/submodal/
subModal回调函数和添加title示例
2个不错的js插件 iBox, subModal
HTML javascript实现模态窗口开源实现总结(lightbox,subModal,greybox,thickbox)
Sizzle是 一个纯js写的CSS选择器引擎,js大师Resig的作品.据说,相比其它主流javascript库,在Firefox 3下快4倍, Opera 9下快3倍, Safari 3下快1.5倍.而且Resig正在说服其它主流的javascrip库的基础CSS选择器引擎也采用Sizzle,目前准备引入Sizzle框架有: jQuery(1.3以上版本已经使用), MochiKit, Prototype, and Dojo.他们的目标也很简单,就是把大家的力量集中在一个统一的CSS选择器引擎上,不用各自为政.
A pure-JavaScript CSS selector engine designed to be easily dropped in to a host library.
Features:
Code Features:
Source Code:
http://github.com/jeresig/sizzle/tree/master
Discussion:
http://groups.google.com/group/sizzlejs
Documentation
window.onload事件可以安全的执行javascript,因为该事件是在页面完全加载完后才开始执行(包括页面内的图片、flash等 所有元素),不会因为JS需要对某个DOM 操作,而页面还没有加载该节点而引起错误。但是这种安全是需要付出代价的:如果某些图片(或者一些别的东西)加载特别慢,那么load事件会等到很久之后 才会触发。针对这个问题,一些JS框架提供了一些补充方法。如:jquery的$(document).ready()、mootools的 domready事件。都是在页面的DOM加载完毕后立即执行,而不需要等待漫长的图片下载过程。如果不使用这些框架,可以使用这个独立的DomReady.js
使用方法:
- <html lang="en">
- <head>
- <script src="domready.js" type="application/javascript"></script>
- <script type="application/javascript">
- DomReady.ready(function() {
- alert('dom is ready');
- });
- </script>
- </head>
- <body>
- </body>
- </html>