Esempio n. 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     ssm.Reset();
     ssm.instructions.Clear();
     ssm.Compile(textBox1.Text);
     begintime = InstructionUtils.GetTimestamp();
     ssm.Run();
 }
Esempio n. 2
0
        public bool perform()
        {
            try
            {
                string url;
                string method;
                string content;

                string printcontent;

                lock (machine)
                {
                    machine.Reset();
                    machine.Run();
                    url          = machine.runtimeRegister["提交URL"];
                    method       = machine.runtimeRegister["提交方法"];
                    content      = machine.runtimeRegister["提交内容"];
                    printcontent = this.printContent.ToString();
                    printContent.Clear();
                }
                HttpWebRequest        req    = BomberUtils.MakeHttpRequest(url, content, method);
                string                result = BomberUtils.GetHttpResponse(req);
                BomberResultEventArgs args   = new BomberResultEventArgs(true, "", "", printcontent, result, null);
                if (null != OnBomberComplete)
                {
                    OnBomberComplete.Invoke(this, args);
                }
                return(true);
            }
            catch (Exception ex)
            {
                BomberResultEventArgs args = new BomberResultEventArgs(false, "", "", "", ex.Message, ex);
                if (null != OnBomberComplete)
                {
                    OnBomberComplete.Invoke(this, args);
                }
                return(false);
            }
        }
Esempio n. 3
0
 public void resetMachine()
 {
     machine.Reset();
     txtOutput.Text = "";
 }