这两篇写的还可以(好吧,我懒):
http://blog.csdn.net/lhq_er/article/details/73518832
http://blog.csdn.net/lhq_er/article/details/73611080