Input/Output 9: FileStream
Written by: maffelu , 2009-04-16 21:30:13
FileStream fs = new FileStream("C:/newFile.txt",
FileMode.Create);
Byte[] bytes = new Byte[2];
bytes[0] = 65;
bytes[1] = 66;
fs.Write(bytes, 0, 2);
fs.Close();
FileStream fs = File.Create("C:/newFile2.txt");
Byte[] bytes = new Byte[2];
bytes[0] = 65;
bytes[1] = 66;
fs.Write(bytes, 0, 2);
fs.Close();
FileStream fs = new FileStream("C:/newFile.txt",
FileMode.Append, FileAccess.Write);
FileStream fs = new FileStream("C:/newFile.txt",
FileMode.Open);
Byte[] bytes = new Byte[2];
int i = fs.Read(bytes, 0, 2);
fs.Close ();
There are no comments on this article.
If you have any question or just want to leave a message, just fill out the form below!
Your e-mail will not be visible in your post, it is for validation reasons only
Maffelu
Creator and admin of MorkaLork.com.
Started programming in HTML back when frames and tables was the way to design a page, moved on to Pascal/Delphi, PHP, javascript/jQuery, VB.NET/C#, Java and C++.
Currently studies .NET (in general) focusing on ASP.NET.