我希望每次按下按钮并使用日期和时间戳名称保存时创建一个新的csv文件。
到目前为止,这是我的代码,但我只能追加或覆盖,文件只创建一次:(
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim csvFile As String = "C:\" & FindDate("", 2) & Time.Replace(":", "") &".csv"
Dim outFile As System.IO.StreamWriter = New StreamWriter(csvFile, False)
outFile.WriteLine("hello")
outFile.Close()
End Sub
答案 0 :(得分:0)
" C:\" &安培; DateTime.Now.ToString(" YYYYMMDDHHMMSS&#34)