Exemplo n.º 1
0
        private void CreateButton_Click(object sender, EventArgs e)
        {
            //
            // Create the output array
            //
            OutputTextBox.Text = "";
            OutputTextBox.Refresh();

            if (InputTextBox.Text.Length == 0)
            {
                return;
            }

            Int32 l = (4 - ((InputTextBox.Text.Length) % 4)) % 4;

            Byte[] tmpB = Encoding.ASCII.GetBytes(InputTextBox.Text +
                                                  sb.ToString().Substring(0, l));
            Int32 f = tmpB.Length;

            Byte[] tmpR = new Byte[f * 2];

            byteRandom.NextBytes(tmpR);

            for (Int32 i = 0; i < tmpB.Length; i++)
            {
                tmpR[i + f] = (Byte)(tmpB[i] ^ tmpR[i]);
            }

            BuildArray(tmpR, 4, "tmpR");
        }
Exemplo n.º 2
0
 private void ClearOutputButton_Click(object sender, EventArgs e)
 {
     OutputTextBox.Text = string.Empty;
     OutputTextBox.Refresh();
     BigResult = string.Empty;
     FixData   = new List <object>();
     VORData   = new List <object>();
     NDBData   = new List <object>();
     SSDlines  = new List <string>();
     FixesUsed = new List <string>();
     APTsUsed  = new List <string>();
 }
Exemplo n.º 3
0
        public void GenerateFinished(string path)
        {
            if (InvokeRequired)
            {
                // We're not in the UI thread, so we need to call BeginInvoke
                BeginInvoke(new StringParameterDelegate(GenerateFinished), new object[] { path });
                return;
            }

            if (Directory.Exists(path))
            {
                this.AppendNormalMsg("Verify Finished");
                this.AppendNormalMsg("");


                string errLogPath = Path.Combine(path, this.LogFileName);

                if (!File.Exists(errLogPath))
                {
                    using (StreamWriter sw = File.CreateText(errLogPath)) { }
                }

                using (StreamWriter sw = File.AppendText(errLogPath))
                {
                    sw.WriteLine("================================================");
                    sw.WriteLine(DateTime.Now.ToUniversalTime().ToString("u"));

                    foreach (string each in this.ErrorLog)
                    {
                        sw.WriteLine(each);
                    }
                }

                foreach (string each in this.ErrorLog)
                {
                    this.AppendNormalMsg(each);
                }
            }

            // enable button
            this.GenerateButton.Enabled = true;

            this._counter = 200;
            this.AppendNormalMsg("");
            OutputTextBox.SelectionStart = OutputTextBox.Text.Length;
            OutputTextBox.ScrollToCaret();
            OutputTextBox.Refresh();
        }
Exemplo n.º 4
0
 private void ClearOutputButton_Click(object sender, EventArgs e)
 {
     OutputTextBox.Text = string.Empty;
     OutputTextBox.Refresh();
 }
Exemplo n.º 5
0
 private void OutputLine(String line)
 {
     mOutputLines.Add(line);
     OutputTextBox.Lines = mOutputLines.ToArray();
     OutputTextBox.Refresh();
 }