Exemplo n.º 1
0
        static void Main()
        {
            CreateLogDirectory();

            string[] args = System.Environment.GetCommandLineArgs();

            if (args.Length > 1)
            {
                try {
                    RunCommandLine(args);
                }
                catch (Exception ex) {
                    ScriptExecutor.SafeWriteLogFile(ex.ToString());
                }

                return;
            }


            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            Application.Run(new MainForm());
        }
Exemplo n.º 2
0
        public string GettLogText()
        {
            StringBuilder message = new StringBuilder();

            //ScriptExecutor.AppendLog(message, "实际请求地址:", this.RealUrl);
            ScriptExecutor.AppendLog(message, "实际请求:", this.Result.RequestText);
            ScriptExecutor.AppendLog(message, "脚本内容:", this.Text);


            if (this.Result != null)
            {
                if (this.Result.Exception == null)
                {
                    if (this.Result.Response == null)
                    {
                        ScriptExecutor.AppendLog(message, "执行结果:", "正在发起请求。");
                    }
                    else
                    {
                        ScriptExecutor.AppendLog(message, "执行结果:", "请求成功。");
                    }
                }
                else
                {
                    ScriptExecutor.AppendLog(message, "异常信息:", this.Result.Exception.ToString());
                }


                if (string.IsNullOrEmpty(this.Result.Response) == false)
                {
                    ScriptExecutor.AppendLog(message, "服务端返回结果:", this.Result.Response);
                }
            }

            return(message.ToString());
        }