Well I'm just entering into the .Net world but I wanna try my best to help ya:
First off, use filestream as well as streamwriter; gotta make sure the file exists first.
Also, don't define sw (Stream_Writer in my examples) so early, define it after the FileName as been determined and the...