Franklin Gray <[EMAIL PROTECTED]> wrote: > The boss decided not to move to 2005 after realizing a lot of things > didn't work in our 2003 app when running in 2005. So, I was wondering how > to do the following in VB framework 1.1: > > Private Function ReadFileBytes(ByVal Filename As String) As Byte() > Return System.IO.File.ReadAllBytes(Filename) > End Function
Get the length of the file (FileStream.Length), create an array of the required length, and iteratively read into it (Stream.Read doesn't necessarily read all bytes requested, but I believe it will always do so for disk files). > Private Sub WriteFileBytes(ByVal FileName As String, ByVal Input() As > Byte) > System.IO.File.WriteAllBytes(FileName, Input) > End Sub Create a file stream and write the array. (This is the "advanced" .NET topics mailing list, right? :) -- Barry -- http://barrkel.blogspot.com/ =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
