TaoZh,
While not an overly complex task, this would take several lines of code. What are really you asking for? Do you have any FDK experience? If you have none, I don't think it is reasonable for someone to take you start-to-finish here. If you are just looking for some tips, that would be a different story. Can you clarify what you want to get here?
Russ