How would I be able to save whats in a textbox, to a text document?

eg: You click the save button, and a message pops up asking you what you want to name it, and then it saves in programs directory?

I would really appreciate the help thanks!