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()); // 시작 시..
-
(Error) Visual Studio 2008 템플릿 정보를 찾지 못했습니다.dev 2009. 11. 20. 18:53
윈도우 복구를 했더니 나타난 빌어먹을 스튜디오 에러. 이런 우라질 브라질 쓰리랑카레이션! -_-++++ 1. Error 현상 "템플릿 정보를 찾지 못했습니다. blah blah~ " 요런 팝업창과 함께 새 프로젝트를 생성할 때 프로젝트 형식이 다 사라졌다. MSDN님, 네이버님과 구글님께 한글로 검색해보았자 응답이 없으시다. 구글님께 영어로 검색하자 바로 신탁! 위 에러에 해당하는 영어 메세지는 "No Visual Studio Template information found. blah blah~ " 2. Error 원인 Visual Studio project template 파일들이 설정된 폴더에 없거나, project template 경로가 잘못 설정되면 발생. 3. Error 해결방법 Visual S..
-
현재 실행중인 함수 이름 가져오기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");