분류 전체보기
-
[C#] Redirect WriteLine stream to a textblockC#/WPF_예제소스 2022. 4. 12. 10:25
Debug.WriteLine // Release 모드로 .exe실행시 실행X, Debug모드 실행파일로 실행시 실행O class TextBoxTraceListener : TraceListener { private TextBox tBox; public TextBoxTraceListener(TextBox box) { this.tBox = box; } public override void Write(string msg) { //allows tBox to be updated from different thread tBox.Dispatcher.BeginInvoke(new Action(() => { tBox.AppendText(msg); }) ); } public override void WriteLine(stri..
-
-
-
[C#] abstract, virtual, overrideC#/기초 2022. 4. 4. 11:25
abstract : 구현하는 놈이 무조건 재 정의해서 써. 1) 메서드에 abstract을 사용하려면 해당 클래스도 abstract로 선언되어야 한다. 2) abstract 키워드로 표시한 속성이나 메서드는 본문을 정의할 수 없고, 파생된 자식클래스에서 이 메서드를 정의 할 수 있다.(반드시 정의 해야함) 3) 접근 한정자 private은 사용이 불가하다. virtual : 디폴트 값은 제공할게 필요하면 재 정의해서 써. 1) 메서드에 virtual 키워드를 붙여야한다. 2) 접근 한정자 private은 사용이 불가하다 3) abstract과 다르게 본문을 정의 할 수 있다. (괄호만 치고 비워 놓아도 됨) 4) 파생클래스에 base. 키워드를 쓰면 부모 클래스에있는 메소드에 있는 내용 실행할 수 있음 ..
-
[WPF] .exe dll 하나로 통합 Release배포C#/WPF 2022. 3. 31. 16:27
dll하나로 통합 => Costura.Fody 누겟 패키지 설치 끝. (Build 메뉴 - Clean project) Project 메뉴 - project Properties Build 탭에 있는 Configuration의 값을 Release로 변경하고 Platform target(Any CPU, x64, x86)을 설정 Ctrl + S 이제 빌드(build)한 프로젝트에서 exe 파일을 추출할 차례입니다. Build 메뉴의 Batch Build 메뉴를 클릭하면 창이 하나 뜹니다. Release 버전으로 체크 후 Build 버튼을 클릭합니다. https://h5bak.tistory.com/188 C# exe 파일(Release 버전) 생성 C#으로 코딩을 완료한 후 exe파일을 추출하는 방법입니다. 비주..
-
[C#]CSV파일C#/WPF_예제소스 2022. 3. 30. 10:22
쓰기 , 콤마로 구분 public void CreateCSV() { //StreamWriter file_CSV = new StreamWriter(new FileStream(path_CSV, FileMode.Create)); StreamWriter file_CSV = new StreamWriter(path_CSV); file_CSV.WriteLine("A\tB\tC\tD"); file_CSV.WriteLine("1, 2, 3, 4, 5"); file_CSV.Close(); } 탭으로 구분 public void CreateCSV() { //StreamWriter file_CSV = new StreamWriter(new FileStream(path_CSV, FileMode.Create)); StreamWrit..