내용 정리는 나중에... 우선 코드만 아래에 ///// Fomr1 public Form1 ( ) { InitializeComponent ( ); dataGridView1.ColumnCount = 2; dataGridView1.Columns [ 0 ].Name = "가수"; dataGridView1.Columns [ 1 ].Name = "노래"; comboBox1.Items.Add ( " - " ); comboBox1.Items.Add ( "-" ); comboBox1.Items.Add ( " ㅡ " ); comboBox1.Items.Add ( "ㅡ" ); comboBox1.SelectedIndex = 0 ; } private void button1_Click ( object sender, EventArg..
전체 폴더 압축 및 해제 라이브러리는 ICSharpCode.dll 사용 ( Download 주소 http://www.icsharpcode.net/: 해당 ICSharpCode 는 GPL을 따름 ) 압축소스는 아래와 같다. private void button1_Click (object sender, EventArgs e) { CreateSample( @"C:\VSM\Admin\압축결과.zip", @"C:\VSM\Admin\압축할폴더" ); } public void CreateSample ( string outPathname, string folderName ) { FileStream fsOut = File.Create ( outPathname ); ZipOutputStream zipStream = new ..
기본적인 Thread 구동은 Thread Thd_1 = new Thread( 동작 함수 명 ) Thread Thd_1 = new Thread ( Function ); Thd_1.Start() Thd_1.Join() 위와 같이 구동되며, 간혹 인수를 전달해야 할 때가 있다. 이때는, // 함수 선언 시, 파라미터의 존재함을 알려주고 Thread Thd_2 = new Thread ( new ParameterizedThreadStart ( Function ) ); Thd_2.Start ( "Argument 1" ); } // Thread 구동 함수 void Function ( object oState ) { if( (string)oState == "What" ) { ... } } 여기서 유념해야 할 것은 in..
using System.Security.Cryptography; static byte[] Skey = ASCIIEncoding.ASCII.GetBytes("PASSWORD"); private void button1_Click (object sender, EventArgs e) { textBox2.Text = Encrypt (textBox1.Text); textBox3.Text = Decrypt(textBox2.Text); } static string Encrypt (string p_data) { // 암호화 알고리즘중 RC2 암호화를 하려면 RC를 // DES알고리즘을 사용하려면 DESCryptoServiceProvider 객체를 선언한다. //RC2 rc2 = new RC2CryptoServicePro..
현재 Process Tree 에 중에서, 특정 이름을 가진 프로세스가 구동 중인지 확인하는 소스입니다. Process.GetProcesses() 를 통해서 전체 리스트를 가져오고 Process Name에 어떤 문자열로 시작하는가를 찾는 것입니다. int n = 0 ; using System.Diagnostics; public void Check_Process_Name() { foreach (Process process in Process.GetProcesses()) { if (process.ProcessName.StartsWith("conhost")) { n++; } } MessageBox.Show( n.ToString() ); ... } 소스는 위와 같습니다. 구동화면은 위와 같고, 현재 conhost..
코드는 Form의 StartPosition을 지정하는 방식을 변경한 후 Form의 Location을 집어 넣는 방식입니다. public Form1() { // Manual 지정 this.StartPosition = FormStartPosition.Manual; // 위치 지정 this.Location = new Point(10,10); this.Show(); .... FormStartPosition 중 CenterScreen 이라는 것도 존재하며( 폼의 위치를 현재 화면의 크기를 고려해 정중앙으로 넣어줌) 두 가지를 혼용하는 방식으로 사용하면 유용하겠습니다. 출처 : http://sjpison.tistory.com/9 : MSDN - http://msdn.microsoft.com/ko-kr/library..
사실 제목은 어렵지만 내용은 아주 간단합니다. 작업을 진행해야 하는데, 그 작업이 시간이 다소 걸려서 사용자에게 편의를 위한 ProgressBar를 보여 주기 위한 소스 입니다. 우선 Form1 과 Form2 가 존재 하고, Form1 에서는 Thread 생성 및 상태를 검사하고 Form2 에서는 필요 Work 및 ProgressBar를 처리합니다. 우선 Form1 소스를 보면 Thread Thread_1; DataTable DT = new DataTable(); private void button1_Click (object sender, EventArgs e) { Thread_1 = new Thread( DoWork ); // Start Thread Thread_1.Start(); // End Thre..
사용 방법은 아래의 코드와 같습니다. 우선 program.cs 파일( 진입점 )의 상단부에, 아래와 같이 DEBUG 를 선언합니다. #define DEBUG using System; 그 다음 사용 코드에서는 public void button1_Click( object sender, EventArgs e ) { #if DEBUG textBox2.Text = "0"; #else textBox2.Text = "1"; #endif } 위 코드에서 보면 DEBUG 가 선언이 되었느냐를 판단하게 됩니다. 우리는 처음 코드에서 DEBUG를 선언했기 때문에 명제는 참이 되면서 textBo2.Text = "0" 으로 출력이 됩니다. 그러나 #define DEBUG 을 주석 처리 하면 명제는 거짓이 되고 두번째 라인인 t..
DataGridView( 이하 DGV1 )는 Column Header 를 클릭하므로써 자동정렬 할 수도 있지만, 때로는 DGV1 에 값을 ADD 시키면서 정렬해야 할 경우가 존재합니다. 이때 사용되는 메써드는 Sort 입니다. 우선 MSDN 의 내용을 살펴 보면 public virtual void Sort( DataGridViewColumn dataGridViewColumn, ListSortDirection direction ) 라고 되어 있는데, DataGridViewColumn 을 집어 넣고, List Sort Direction( 방향 )이라고 나와 있습니다. 아래의 예문을 보시면 DGV1.Sort( DGV1.Columns["Code"], ListSortDirection.Ascending ); 위와 ..
- Total
- 331,919
- Today
- 0
- Yesterday
- 89
- 알프스목초지1-4
- Joseph Redmon
- 리눅스
- C# 패널
- 자신만의향
- PolyBridge1-4
- DaleEvans
- C# 패널 예제
- PolyBridge1-3
- 믿는다는것
- 알프스목초지1-3
- PolyBridge1-5
- PolyBridge하는법
- 인생의시간
- 알프스목초지1-2
- PolyBridge1-1
- OnlyICan
- 분할작업
- Nina Fedoroff
- 1Day1Sentence
- c#
- 알프스목초지1-1
- 사람의인생
- ted
- PolyBridge
- 좋은글귀
- 알프스목초지1-5
- PolyBridge1-2
- 폴리브릿지
- C# 판넬 예제
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 |
- 2017/08 (4)
