File name
Commit message
Commit date
File name
Commit message
Commit date
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 SignusKH
{
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;
/// <summary>
/// 해당 응용 프로그램의 주 진입점입니다.
/// </summary>
[STAThread]
static void Main()
{
bool createNew = false;
//프로그램 중복실행 방지
System.Threading.Mutex mutex = new System.Threading.Mutex(true, "__U3_SIGNUS_KH_W__MUTEX__", out createNew);
if (createNew == false)
{
MessageBox.Show("프로그램이 이미 실행중입니다.", "SIGNUS");
return;
}
U3Util.ErrorLog("프로그램 시작");
messageQuit = RegisterWindowMessage("MSG_SIGNUS_QUIT");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
U3Util.ErrorLog("프로그램 종료");
}
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
{
}
}
}
}
}