I have never understood these messages so i am attempting to work it out.
Does the below message say that a paremeter in the module LogFile has a zero length?
On my pc clsStream.Write(bFile, 0, bFile.Length) holds values but on 2 w10 pc's this has caused errors.
Code:************** Exception Text ************** System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy) at System.String.Substring(Int32 startIndex, Int32 length) at TakeoffExpress.LogFile.gGetInfo() at TakeoffExpress.Form1.Form1_Load(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Windows.Forms.Form.OnLoad(EventArgs e) at System.Windows.Forms.Form.OnCreateControl() at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) at System.Windows.Forms.Control.CreateControl() at System.Windows.Forms.Control.WmShowWindow(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ScrollableControl.WndProc(Message& m) at System.Windows.Forms.ContainerControl.WndProc(Message& m) at System.Windows.Forms.Form.WmShowWindow(Message& m) at System.Windows.Forms.Form.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Code:Module LogFile Public Sub uUpLoadLogFile() 'deleted code here to save your eyes clsRequest.Method = System.Net.WebRequestMethods.Ftp.AppendFile 'read into existing log.txt file... Dim bFile() As Byte = System.IO.File.ReadAllBytes(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "/TakeoffExpress/Log/Log.txt") ' upload file... Dim clsStream As System.IO.Stream = clsRequest.GetRequestStream() clsStream.Write(bFile, 0, bFile.Length) clsStream.Close() clsStream.Dispose() 'deleted code here to save your eyes End Sub




Reply With Quote