public void logError(string data) { try { create_log_dir(); my.file_put_contents(LOG_PATH + "\\" + my.date("Y-m-d") + ".txt", my.date("Y-m-d H:i:s") + ":\r\n" + data + "\r\n", true); } catch { } }
public void logError(string data) { try { if (!my.is_dir(LOG_PATH)) { my.mkdir(LOG_PATH); } my.file_put_contents(LOG_PATH + "\\" + my.date("Y-m-d") + ".txt", my.date("Y-m-d H:i:s") + ":\r\n" + data + "\r\n", true); } catch { } }
/* private void run_f2() * { * f2 = new Form2(); * f2.InitializeComponent(); * f2.Show(); * f2.TopMost=true; * f2.Load += new System.EventHandler(); * * * } */ private void Form1_Load(object sender, EventArgs e) { //AviManager aviManager = new AviManager(@"E:\5.program\C#\my_cam_old\my_cam\bin\Debug\video\2019-06-23_20_08_40.avi", true); //添加音频 //String fileName = @"E:\5.program\C#\my_cam_old\my_cam\bin\Debug\video\aaa.wav"; //aviManager.AddAudioStream(fileName, 0); //aviManager.Close(); //AviManager aviManager = new AviManager(@"E:\5.program\C#\my_cam_old\my_cam\bin\Debug\video\2019-06-23_20_41_08.avi", true); //aviManager.AddAudioStream(@"E:\5.program\C#\my_cam_old\my_cam\bin\Debug\video\2019-06-23_20_41_08.wav", 0); //aviManager.Close(); _proc = HookCallback; r_btn = this.run_btn; // From : https://dotblogs.com.tw/huanlin/2008/04/23/3320 // From : https://dotblogs.com.tw/huanlin/2008/04/23/3319 _hookID = SetHook(_proc); this.Left = Screen.PrimaryScreen.Bounds.Width - this.Width - 120; this.Top = Screen.PrimaryScreen.Bounds.Height - this.Height - 120; //f2_t = new Thread(run_f2); //f2_t.Start(); f2 = new Form2(); f2.Show(); f2.UI_Init(); video_path = my.pwd() + "\\video"; log(video_path); if (!my.is_dir(video_path)) { my.mkdir(video_path); } mn = my.date("Y-m-d_H_i_s"); video_path = my.pwd() + "\\video\\" + mn + ".avi"; audio_path = my.pwd() + "\\video\\" + mn + ".wav"; log(video_path); log(audio_path); }