参见
http://book.csdn.net/bookfiles/154/1001546578.shtml
http://www.cnblogs.com/VitoriaTang/archive/2007/10/31/282201.html