1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
Dim sFileName AsString = Application.StartupPath.ToString & "\" & CType(Format(Date.Now, "yyyy-MM-dd"), String) & ".txt"
If File.Exists(sFileName) Then
Dim fs AsNew System.IO.FileStream(sFileName, IO.FileMode.Append, IO.FileAccess.Write)
Dim sw AsNew System.IO.StreamWriter(fs)
sw.Write("TC1->EV1 " & TextBox1.Text)
sw.Flush()
sw.Close()
fs.Close()
Else
Dim fs AsNew System.IO.FileStream(sFileName, IO.FileMode.Create, IO.FileAccess.Write)
Dim sw AsNew System.IO.StreamWriter(fs)
sw.WriteLine("TC1->EV1 " & TextBox1.Text)
sw.Flush()
sw.Close()
fs.Close()
EndIf
|
Partager