http://community.csdn.net/Expert/topic/3165/3165492.xml?temp=.8359491
http://community.csdn.net/Expert/topic/3166/3166258.xml?temp=.6705438
http://community.csdn.net/Expert/topic/3166/3166258.xml?temp=.6705438
写得很详细了
源码我手上没有 你可以搜搜