Exemplo n.º 1
0
        public WordFile(string filename)
        {
            this._filename = filename;

            // Datei öffnen
            var theStreamReader = new System.IO.FileInfo(filename).OpenText();
            var content         = theStreamReader.ReadToEnd();

            theStreamReader.Close();
            // Datei Strings in Array Speichern
            this._words = content.Split("\r\n");
        }
Exemplo n.º 2
0
        public Cipher(string cipherFilename)
        {
            // Datei öffnen
            var theStreamReader = new System.IO.FileInfo(cipherFilename).OpenText();
            var content         = theStreamReader.ReadToEnd();

            theStreamReader.Close();
            // Datei Strings in Array Speichern
            string[] BytestringArray = content.Split(' ');
            // Byte Array erstellen zur aufnahme der umgewandelten Bytes
            this._ByteArray = new byte[BytestringArray.Length];
            // Jedes String Element umwandeln in Byte
            for (int i = 0; i < BytestringArray.Length; i++)
            {
                this._ByteArray[i] = Convert.ToByte(BytestringArray[i], 2);
            }
        }