dev/C#
-
Process 실행시키기dev/C# 2009. 11. 25. 15:02
외부 실행파일("*.exe")을 실행기키기 Application 만들다가 외부 프로그램을 실행시킨 뒤, 실행이 끝나면 어떤 처리를 해야 할 경우 1. 동기 : WaitForExit() 이용 Process proc = Process.Start("notepad.exe"); proc.WaitForExit(); 정보를 대략 출력해보면, Process proc = Process.Start("notepad.exe"); proc.WaitForExit(); Console.WriteLine("Process FileName: " + proc.StartInfo.FileName); // 프로세스 이름 Console.WriteLine("Start time: " + proc.StartTime.ToString()); // 시작 시..
-
현재 실행중인 함수 이름 가져오기dev/C# 2009. 9. 16. 15:56
에러 처리할 때 어느 함수에서 에러가 났는지 로그가 남으면 알기 편할 것 같아서 로거를 만들다가... 현재 실행중인 함수 이름 가져오기 using System.Reflection; void FunctionNameTest() { string currentFunction = MethodBase.GetCurrentMethod().Name; try { } catch (Exception ex) { Console.WriteLine("ERR at {0}.", currentFunction); } finally { } } 이런식으로 사용하면 된다. 더 자세한 함수 호출관계를 알려면 StackTrace, StackFrame, MethodBase 클래스들을 잘 섞어쓰면 된다. (관련예제 자세한 것 http://www.cod..
-
Process 실행dev/C# 2009. 9. 14. 21:31
using System.Diagnostics; Process.Start(@"D:/runtest/run.exe");