Пример #1
0
        public static void WriteCmdLog(string cmd)
        {
            string time = DateTime.UtcNow.ToString();

            StreamWriter writer = new StreamWriter(Configurations.GetAbsoluteLogCmdFilePath(), true);

            writer.WriteLine("---START: " + time + "---");
            writer.WriteLine(cmd);
            writer.WriteLine("---END: " + time + "---");
            writer.Close();
        }
Пример #2
0
 private void print_results(string r)
 {
     if (this.textBox_log_auto.InvokeRequired)
     {
         this.textBox_log_auto.Invoke(new ChangeUIThread_2(this.print_results), new object[] { r });
     }
     else
     {
         this.textBox_log_auto.Text = this.textBox_log_auto.Text + r + "\r\n";
         if (textBox_log_auto.Text.Length > Configurations.console_buffer_length)
         {
             if (Configurations.store_cmd_log_in_file)
             {
                 Log.WriteCmdLog(textBox_log_auto.Text);
                 textBox_log_auto.Text = "To see previous commands look at " + Configurations.GetAbsoluteLogCmdFilePath() + "\r\n";
             }
             else
             {
                 textBox_log_auto.Text = "";
             }
         }
     }
 }