VB.NET
Dim bs As Byte() = New Byte() {&H44, &H4F, &H42, &H4F, &H4E, &H2E, &H4E, &H45, &H54}
Dim fs As New System.IO.FileStream("C:\strtext.txt", _
System.IO.FileMode.Create, _
System.IO.FileAccess.Write)
fs.Write(bs, 0, bs.Length)
fs.Close()
C#byte[] bs = new byte[] { 0x44, 0x4f, 0x42, 0x4f, 0x4e, 0x2e, 0x4e, 0x45, 0x54 };
System.IO.FileStream fs = new System.IO.FileStream(
@"C:\strtext.txt",
System.IO.FileMode.Create,
System.IO.FileAccess.Write);
fs.Write(bs, 0, bs.Length);
fs.Close();
ストリームを利用しないでファイル操作を行う方法VB.NET
Dim bs As Byte() = System.IO.File.ReadAllBytes("C:\test.txt")
System.IO.File.WriteAllBytes("C:\nostr.bak", bs)
C#byte[] bs = System.IO.File.ReadAllBytes(@"C:\test.txt");
System.IO.File.WriteAllBytes(@"C:\nostr.bak", bs);