|
-
Jul 8th, 2008, 09:11 PM
#1
Thread Starter
Addicted Member
[2005]Code VB6 to VB.Net
I have this code: VB6
Code:
create an file.txt that has the following lines inside
Open "file.txt" For Output As #1
Write #1, "WindowMode" "0"
Write #1, "Graphic", "0"
Write #1, "ColorBPP", "16"
Write #1, "Network", "0"
Write #1, "CameraInvert", "false"
Write #1, "MotionBlur", "false"
Write #1, "CameraSight", "ON"
Write #1, "ScreenSize", "0"
Write #1, "Sound", "On"
Write #1, "Server1", "64.56.75.249"
Write #1, "Server2", "64.56.75.249"
Write #1, "Server3", "64.56.75.249"
Write #1, "Account", " "
Close #1
how change to VB.Net ?
-
Jul 8th, 2008, 09:16 PM
#2
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.
-
Jul 8th, 2008, 09:17 PM
#3
Re: [2005]Code VB6 to VB.Net
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 8th, 2008, 09:31 PM
#4
Thread Starter
Addicted Member
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!
-
Jul 8th, 2008, 09:39 PM
#5
Thread Starter
Addicted Member
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
-
Jul 8th, 2008, 09:41 PM
#6
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.
-
Jul 8th, 2008, 09:42 PM
#7
Re: [2005]Code VB6 to VB.Net
Double up on the double quotes.
Try...
Code:
objStreamWriter.WriteLine("""WindowMode"" ""1""")
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 8th, 2008, 09:47 PM
#8
Thread Starter
Addicted Member
Re: [2005]Code VB6 to VB.Net
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|