본문 바로가기

C# /WindowsForm35

C# Windows Form 타이틀 바 숨기기 예제가 형편없어 죄송합니다 ;; private void ViewerFrm_Load(object sender, EventArgs e) { InitControl(); } private void InitControl() { // 창 크기를 최대화 한다. this.WindowState = FormWindowState.Maximized; // 백그라운드 색상 설정 this.BackColor = Color.White; // 폼 보더 스타일을 None으로 설정 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; } 2016. 2. 16.
FileSystemWatcher를 이용한 파일 변경 및 생성 감시 간단한 예제!! 예제가 성의없어 죄송합니다 -_-;; FileSystemWatcher fswTEST = null; private void ViewerFrm_Load(object sender, EventArgs e) { InitControl(); EventHandler(); } private void InitControl() { fswTEST = new FileSystemWatcher(); // 파일을 감시할 경로 설정 fswTEST.Path = Path.GetPathRoot(Environment.SystemDirectory) + "watchFolder"; // txt 파일의 확장자만 검색 fswTEST.Filter = "*.txt"; } private void EventHandler() { //이벤트 핸들러 설정 fsw.. 2015. 12. 18.
enum Flags Attribute static void Main() { PipeDirection d = PipeDirection.B | PipeDirection.C; Console.WriteLine(d); Console.WriteLine((int)d); } [Flags] public enum PipeDirection : uint { A = 0x01, B = 0x02, C = 0x04 } 16진수 B와 C를 더하면 6 결과는 B,C 6 Flags 를 주석 처리 하면 결과는 6 6 이 나옵니다 ;; 전 아직 정확히 이해를 못한상태입니다=0=;; 2015. 12. 1.
C# 퍼센트 구하기 간단한 예제 decimal a = 2000; int prdcqty = 1000; Console.WriteLine((prdcqty / (float)a) * 100); // 결과 50 형편 없는 예제라 죄송합니다 ;; 2015. 9. 15.