I am trying to use the streamwriter to write to a text file
I declare the streamwriter publically at the beginning
im filename As String
Dim Drive As String
Dim oFile As System.IO.File
Dim ofile2 As System.IO.File
Dim nopatch As System.IO.Strea mWriter
Dim error1 As System.IO.Strea mWriter
Dim testfile As System.IO.Strea mWriter
Dim dir As String
After a button click I try to write some data ased on conditions. The files
appear but they are empty. I check the values of the variables and they all
of text associated
'create the initial output files and directories
dir = TextBox3.Text & "\"
Directory.Creat eDirectory(dir)
nopatch = oFile.CreateTex t(dir & "nopatch.tx t")
error1 = ofile2.CreateTe xt(dir & "error.txt" )
testfile = oFile.CreateTex t("C:\output\te st.txt")
testfile.WriteL ine("test")
Actual Write process
Catch ex As Exception
exout = ex.ToString
errorout = computer & "," & servername & "," & exout
error1.WriteLin e(errorout)
testfile.WriteL ine("test")
testfile.WriteL ine(errorout)
End Try
I declare the streamwriter publically at the beginning
im filename As String
Dim Drive As String
Dim oFile As System.IO.File
Dim ofile2 As System.IO.File
Dim nopatch As System.IO.Strea mWriter
Dim error1 As System.IO.Strea mWriter
Dim testfile As System.IO.Strea mWriter
Dim dir As String
After a button click I try to write some data ased on conditions. The files
appear but they are empty. I check the values of the variables and they all
of text associated
'create the initial output files and directories
dir = TextBox3.Text & "\"
Directory.Creat eDirectory(dir)
nopatch = oFile.CreateTex t(dir & "nopatch.tx t")
error1 = ofile2.CreateTe xt(dir & "error.txt" )
testfile = oFile.CreateTex t("C:\output\te st.txt")
testfile.WriteL ine("test")
Actual Write process
Catch ex As Exception
exout = ex.ToString
errorout = computer & "," & servername & "," & exout
error1.WriteLin e(errorout)
testfile.WriteL ine("test")
testfile.WriteL ine(errorout)
End Try
Comment