Mell:
I'm not too sure about the saveFileDialog function off the top of my head, but its probably not what you need. The textbox will be the same as the listbox, all you are doing is capturing the data that is in the object and writing it to a file. The type of object is not important, only the data. Also, basic file IO operations don't have anything to do with databases, they are more simple than that.
cmos:
As for your issue, try assigning a value to your filenumber variable, or just use a solid value instead of a variable. For example:
FileSystem.FileOpen(1, "d:\to\tteste.txt", OpenMode.Output)
FileSystem.PrintLine(1, "ssss 1")
Give that a shot.
Jim