1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42:
| using System; using System.Collections.Generic; using System.Text; using System.IO;
namespace ESA { class Program {
public void ESA3In(string pfad, byte[] array) { FileStream stream1 = File.Open(pfad, FileMode.Create); stream1.Write(array, 0, array.Length); stream1.Close();
} public void ESA3Out(string pfad) { FileStream stream2 = File.Open(pfad, FileMode.Open); byte[] array = new byte[stream2.Length]; stream2.Read(array, 0, (int)stream2.Length); for (int i = 0; i < array.Length; i++) { Console.Write( array[i]); } Console.WriteLine(); stream2.Close(); } static void Main(string[] args) { Program test = new Program(); string pfad = @"C:\Musterneu.txt"; byte[] content = { 1, 2, 3, 4,5,6,7,8,9, 10,11,12,13,14,15,16,17,18, 19,20,21,22,23,24,25,26,27};
test.ESA3In(pfad, content); test.ESA3Out(pfad); |