Re: [2005]Code VB6 to VB.Net
Your first stop should always be MSDN.
http://search.msdn.microsoft.com/Def...us&refinement=
Look first, ask questions later. We can help with specifics but, in my opinion at least, you should always look for yourself first. That's how you learn the most.
Re: [2005]Code VB6 to VB.Net
Re: [2005]Code VB6 to VB.Net
Here code:
vb Code:
Dim objStreamWriter As StreamWriter
objStreamWriter = New StreamWriter("Testfile.txt")
objStreamWriter.WriteLine("line1")
objStreamWriter.WriteLine("line2")
objStreamWriter.WriteLine("line3")
objStreamWriter.Close()
Thanks!
Re: [2005]Code VB6 to VB.Net
Problem!!
I need write this line in file: "WindowMode" "1"
Then I make:
Code:
objStreamWriter.WriteLine(""WindowMode" "1"")
" + " = ERROR
ERROR: Comma, ')', or a valid expression continuation expected.
Help :(
Re: [2005]Code VB6 to VB.Net
Any literal double quotes in a string must be escaped with an extra double quote:
vb.net Code:
objStreamWriter.WriteLine("""WindowMode"" ""1""")
Note that that is true of any string literal. It's not specific to writing files.
Re: [2005]Code VB6 to VB.Net
Double up on the double quotes.
Try...
Code:
objStreamWriter.WriteLine("""WindowMode"" ""1""")
Re: [2005]Code VB6 to VB.Net