With your help I have been able to create the following code that writes text to a file:
Code:
Imports System.IO Imports System.IO.StreamReader Sub Main(ByVal varParameters) Const strDebug = 1 Const strFilename = "C:\Program Files\HomeSeer 2\data\DJ\ftpthis.txt" If File.Exists(strFilename) then File.Delete(strFilename) PrintToFile(strFilename,"my string written to file") End Sub Function PrintToFile(strFilename,msg) Dim oSW As StreamWriter oSW = File.AppendText(strFilename.ToString()) oSW.WriteLine(msg) oSW.Close() End Function
Leave a comment: