📜  vbnet 创建和写入文件 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:39.309000             🧑  作者: Mango

代码示例1
Dim strFile As String = "yourfile.txt"
Dim fileExists As Boolean = File.Exists(strFile)
Using sw As New StreamWriter(File.Open(strFile, FileMode.OpenOrCreate))
    sw.WriteLine( _
        IIf(fileExists, _
            "Error Message in  Occured at-- " & DateTime.Now, _
            "Start Error Log for today"))
End Using