WriteAllBytes Method


WriteAllBytes Method

Location

My.Computer.FileSystem.WriteAllBytes

Syntax

 My.Computer.FileSystem.WriteAllBytes(path, byteData, append) 


path (required; String)

The path of the file to be written


byteData (required; Byte array)

The data to be written to the file


append (required; Boolean)

Indicates whether the data will be appended to the end of the file's existing content (true) or replaces any existing content (False)

Description

The WriteAllBytes method writes the content of a Byte array to a specified file. If the file does not exist, it will be created, as long as the path specified with the file name is valid.

Usage at a Glance

  • An exception is thrown if the path parameter is missing or invalid, or if the file exists and is in use.

  • An exception is thrown if the user lacks sufficient file-access permissions.

Related Framework Entries

  • Microsoft.VisualBasic.FileIO.FileSystem.WriteAllBytes Method

  • Microsoft.VisualBasic.MyServices.FileSystemProxy.WriteAllBytes Method

See Also

FileSystem Object, OpenTextFieldParser Method, OpenTextFileReader Method, OpenTextFileWriter Method, ReadAllBytes Method, ReadAllText Method, WriteAllText Method




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net