Console application: save strings to a file
If you need help with a project or need to know how to do something specific in VB.NET then please ask your questions in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
3 posts
Page 1 of 1
How can I save a string (or multiple strings) to a file (normal plain text in the curdir() ) in a console application?
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
Code: Select all
Module modMain
Dim exit_app As Boolean
Dim content As String
Sub Main()
Process.Start(CurDir)
While Not exit_app
Dim line As String = Console.ReadLine
If line = "write" Then
My.Computer.FileSystem.WriteAllText("file.txt", content, False)
Else
content += line & vbNewLine
End If
End While
End Sub
End Module
Ill try it tomorrow, got not so much spare time today. Thx for the effort alrdy Niko!
Practice makes perfect!
VIP since: 6-10-2011
VIP since: 6-10-2011
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023