using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using System.Windows.Forms; using System.Runtime.InteropServices; using System.IO; namespace SignusKHSVR { static class Program { [DllImport("user32.dll")] public static extern uint RegisterWindowMessage(string lpString); [DllImport("user32.dll")] public static extern bool PostMessage(IntPtr hWnd, uint Msg, uint wParam, uint lParam); public static uint messageQuit = 0; /// /// 해당 응용 프로그램의 주 진입점입니다. /// [STAThread] static void Main() { bool createNew = false; //프로그램 중복실행 방지 System.Threading.Mutex mutex = new System.Threading.Mutex(true, "__U3_SIGNUS_KHSVR_W__MUTEX__", out createNew); if (createNew == false) { MessageBox.Show("프로그램이 이미 실행중입니다.", "SIGNUS"); return; } U3Config config = new U3Config(); SFLogApi log = new SFLogApi(); log.Run(); messageQuit = RegisterWindowMessage("MSG_SIGNUS_QUIT"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } static public void DeleteOldFiles(string dirName, int nSec) { DateTime dt = DateTime.Now.AddSeconds(-nSec); string[] files = Directory.GetFiles(dirName); foreach (string file in files) { try { FileInfo fi = new FileInfo(file); if (fi.CreationTime < dt) fi.Delete(); } catch { } } } static public void MoveFiles(string srcDir, string dstDir) { string[] files = Directory.GetFiles(srcDir); foreach (string file in files) { try { FileInfo fi = new FileInfo(file); if(fi.Length > 0) { File.Move(file, dstDir + "\\" + fi.Name); } } catch { } } } } }