Basically, don't.
Console applications are intended to run in the older, traditional method and are called "procedural applications": the code tells the user what to do and is in control at all times.
Windows applications don't: they respond to events (of which there are a huge number) and do things as a result of that - the user is (at least nominally) in charge and can do anything he wants in whatever sequence suits him.
So where a Console app will go:
"Enter name:"
"Enter address:"
"Insert to database? (Y/N): "
A windows application would have two textboxes and an "Insert" button - and the user can fill in what he wants and press the button when he is ready.
So converting a Console app to Windows isn't simple, and doesn't end up with a "good" windows app - and in your case what it ends up with is a very frustrating experience for the user as he can't tell if the app had crashed or is working because most of what the code is doing is executing what are called "blocking calls"; ones which do not return until the operation is fully complete, which can take between seconds and forever!
To use that code in a Windows app that won't get uninstalled with extreme prejudice is extremely complicated: you will need to learn about threading, Invoking, and about how to get and present information to the user.
Basically, if you want a Windows chat app to play with, go find a Windows chat app - there are plenty of them - you do not want to start from a console version!