public static void 追加日志(string txt) { // Txthelper tx = new Txthelper(); Txthelper.WriteLine(Directory.GetCurrentDirectory() + "\\Log\\project" + DateTime.Now.ToString("yyyyMM", CultureInfo.InvariantCulture) + ".log", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) + " " + txt); }
public async void TextShow(String tmpPath) { string str = ""; Task t = Task.Run(() => { str = Txthelper.ReadFile(tmpPath); }); await t; this.textBox1.Text = str; this.textBox1.SelectionStart = this.textBox1.Text.Length; this.textBox1.ScrollToCaret(); this.textBox1.ReadOnly = true; }
public void TextShow1(String tmpPath) { string str = ""; // Task t=Task.Run(() => {str= Txthelper.ReadFile1(tmpPath); // } ); str = Txthelper.ReadFile1(tmpPath); // await t; ShowLog(str); // this.Invoke(new Action(() => // { // this.textBox1.Text = str; // this.textBox1.SelectionStart = this.textBox1.Text.Length; // this.textBox1.ScrollToCaret(); // this.textBox1.ReadOnly = true; // } // )); }
/// <summary> /// 保存Config /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void ToolStripMenuItem13Click(object sender, EventArgs e) { Txthelper.Write(path1, textBox1.Text); MessageBox.Show("保存成功"); // ZhiLian.XmlFactoryCreatefile(); }
public static void 追加日志(string fileName, string txt) { // Txthelper tx = new Txthelper(); Txthelper.WriteLine(fileName, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture) + " " + txt); }