Sqlite 역시 다른 DB 와 마찬가지로 master table 이 존재한다는 것을 알게 되었습니다. string sQuery = "select count(*) from sqlite_master Where Name = 'table_name'; result - 0 : 존재하지 않음 - 1 : 존재 출처 : http://bloodguy.tistory.com/entry/SQLite3-%ED%85%8C%EC%9D%B4%EB%B8%94-%EC%A1%B4%EC%9E%AC-%EC%97%AC%EB%B6%80-%EC%B2%B4%ED%81%AC-check-table-exists
ListView 에는 check box 를 추가하는 기능이 있습니다. 그중 check 된 것만 골라내야 하는 경우가 생기는데 전체 리스트를 돌면서 check box 가 true 인 것을 찾는 것이 아닌 체크된 항목만 끄집어 내는 방법이 있습니다. 방법은 listView1 의 checkeditems 를 찾고, ListviewItem 에 하나씩 넣은 다음 처리하는 것입니다. foreach (ListViewItem item in listView1.CheckedItems) { textBox1.AppendText( item.SubItems[0].Text + "\n" ); item.BackColor = Color.Aquamarine; } 추가 : item.BackColor 는 해당 라인 색 변경에 사용됩니다. 출처..
C# 같은 경우 해당 폼이 완전 load 가 완료된 시점을 찾기가 어렵다. 그런 메써드가 있는 것도 아니고.. 그래서 검색하다가 나온 것은 임시 방편으로 사용할만한 것인데, Application 의 상태가 idle -> 놀고 있다는 것은, 로딩이 완료됐다는 시점을 찾고 그 시점이 됐을 때, 원하는 것을 실행 시키는 것이다. 필자의 경우, 메시지 박스를 통해서 버전체크를 하고, 버전이 다르다면 업데이트를 하겠냐는 메시지 박스를 띄우려고 했는데 Form load 가 다 완료 되기도 전에 메시지 창이 뜨는 오류가 있었다. 그래서 아래와 같은 코드를 사용하게 되었다. public Mainform() { InitializeComponet(); Application.Idle += Check_Version; } pr..
원래 닷넷을 이용하는 사용자라면 굉장히 쉽게 할 수 있습니다. 그것은 바로 is64bitOperatingSystem입니다. 반환 형태가 bool 이고 운영체제가 64 이면 true, 32 이면 false 를 반환해 줍니다. 위에를 보면 닷넷 환경 4.5 또는 4 에서 지원해주는 것을 알 수 있습니다. 그러나 필자는 좀 부득이하게 3.5 환경에서 개발하게 되어서 다른 방법을 찾을 수 밖에 없었는데 그것은 바로 windows 아래에 있는 syswow64 폴더 입니다. 기본적인 32 bit os 라면 존재하지 않지만 64 bit 이상의 운영체제에서는 syswow64 라는 폴더가 존재 합니다. if (Directory.Exists(@"C:\windows\syswow64")) { // 64 bit } else {..
// 원본과, 목적지를 같이 대입 public void CopyFolder (string sourceFolder, string destFolder ) { if (!Directory.Exists(destFolder)) Directory.CreateDirectory(destFolder); string[] files = Directory.GetFiles(sourceFolder); string[] folders = Directory.GetDirectories(sourceFolder); foreach (string file in files) { string name = Path.GetFileName(file); string dest = Path.Combine(destFolder, name); File.Copy(f..
static Timer myTimer = new Timer(); static int alarmCounter = 1; static bool exitFlag = false; private static void timerEventProcessor( object myObject, EventArgs myEventArgs ) { // event 발생시 timer stop myTimer.Stop(); // messageBox 를 이용해서 Yes No 를 판단하고 flag 또는 counter 를 변화 시킵니다. if (MessageBox.Show("Conuinue?", "Count :" + alarmCounter, MessageBoxButtons.YesNo) == DialogResult.Yes) { alarmCount..
using System.Security.Cryptography; private void button1_Click(object sender, EventArgs e) { textBox3.Text = AESEncrypt256(textBox2.Text ); } private void button2_Click(object sender, EventArgs e) { textBox4.Text = AESDecrypt256(textBox3.Text); } public String AESEncrypt256(String InputText ) { string Password = textBox1.Text; RijndaelManaged RijndaelCipher = new RijndaelManaged(); // 입력받은 문자열을 ..
using System.Runtime.InteropServices; namespace test_ini { class Program { // get [DllImport("kernel32")] private static extern int GetPrivateProfileString( string section, string key, string def, StringBuilder retVal, int size, string filePath); // write [DllImport("kernel32")] private static extern long WritePrivateProfileString( string section, string key, string val, string filePath); static..
using System.Reflection; namespace test_versionCheck { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { Assembly asm = Assembly.LoadFrom(@"C:\YPM\YPM2013.exe"); AssemblyName name = asm.GetName(); MessageBox.Show( name.Version.ToString() ); } } } using 구문을 보면 reflection( 한 : 반영 ) 이란 namespace를 이용한 것입니다. Assembly..
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace Test { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { bool isSuccess = false; // 1 try { Console.WriteLine("정상적인 실행"); //throw new Null..
- 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)
