FileSystem.WriteAllBytes Method
Writes data to a binary file.
Assembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
Parameters
- file
- Type: System.String
String. Path and name of the file to be written to. Required.
- data
- Type: System.Byte[]
Byte. Data to be written to the file. Required.
- append
- Type: System.Boolean
Boolean. Whether to append or overwrite data. Default is False. Required.
For more detailed information, see the Visual Basic topic My.Computer.FileSystem.WriteAllBytes Method.
If the append parameter is True, it appends the data to the file; otherwise data in the file is overwritten.
If the specified path, excluding the file name, is not valid, a DirectoryNotFoundException exception will be thrown. If the path is valid but the file does not exist, the file is created.
The following table lists an example of a task involving the My.Computer.FileSystem.WriteAllBytes method.
|
To |
See |
|---|---|
|
Write to a binary file |
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.