Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
VB.NET
VB.NET General Discussion
Writing lines in text file
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Ab99, post: 186032, member: 74738"] I want to create an text file and want to write lines in it. Creating the text file is not the problem. But I can not write outside the Sub Form Load. I have many subs were I want to writes lines into the same txt file. [CODE lang="vbnet" title="Writing in an text file"] Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.WindowState = FormWindowState.Maximized Timer4.Enabled = False comPORT1 = "" For Each sp As String In My.Computer.Ports.SerialPortNames Compoort1_ComboBox.Items.Add(sp) Next '### Timer10.Enabled = False comPORT2 = "" For Each sp As String In My.Computer.Ports.SerialPortNames Compoort2_ComboBox.Items.Add(sp) Next Dim Datumtijd As Date = Now() fPath = "C:\TimingForHorses\Logging\log001.txt" Dim afile As New IO.StreamWriter(fPath, True) afile.WriteLine("hello1") afile.Close() End Sub[/CODE] How should I do this? [/QUOTE]
Insert quotes…
Verification
Post reply
VB.NET
VB.NET General Discussion
Writing lines in text file
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom