Horje
write to text file vb.net Code Example
write to text file vb.net
'streamwriter allows us to write to a file
Dim file As System.IO.StreamWriter

file = My.Computer.FileSystem.OpenTextFileWriter([FileName], True)
file.WriteLine([text])
file.Close()
vbnet create and write on file
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
write to text file vb.net
Dim [FileVar] As String = Application.StartupPath & "/[FileName]"

FileOpen(1, [FileVar], OpenMode.Append)
PrintLine(1, text)
FileClose(1)




3

Related
excel vba copy range with filter Code Example excel vba copy range with filter Code Example
shortcut to apply a formula to an entire column in excel Code Example shortcut to apply a formula to an entire column in excel Code Example
xlvba check for folder Code Example xlvba check for folder Code Example
excelvba check for directory Code Example excelvba check for directory Code Example
random number generator vb.net Code Example random number generator vb.net Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11