Category (302) 썸네일형 리스트형 [C#] Extension Methods 사용법 Extension Methods 사용법은 2가지이다. 기존의 static method 사용법과 동일하게 쓰는 방법도 가능하다. 아래 예제는 exception 발생없이 잘 실행된다. Extension methods are static methods. Extension methods can only be declared in static classes. using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string s = "123"; int i = s.ToInt32(); int j = Extensions.ToInt32(s); Console.WriteLine(i); Console.Write.. [C#] const vs readonly const 대 readonly 비교 using System; namespace Test { class Program { static void Main(string[] args) { Some s1 = new Some(); Console.WriteLine(Some.constField); // const : 항상 static Console.WriteLine(s1.readonlyField1); Console.WriteLine(s1.readonlyField2); Some s2 = new Some(5); Console.WriteLine(s2.readonlyField2); } } class Some { // const readonly 공통 : 클래스 밖에서 값을 바꿀 수 없음 // const : 항상 static (.. Project Templates problem with Database Professionals Add-on I use Visual Studio 2005 Team Suite on Windows XP SP2 Korean. I installed [Visual Studio 2005 Team Edition for Database Professionals Add-on] And I changed [International Settings Language] from [English] to [Same as Microsoft Windows] (in this case, Korean) After that, All project templates for Visual C#, Visual Basic, and Visual J# are gone. Set VS2005 Language Option to English Tools > Option.. iPAQ hx4700 WM5 Clean Reset To perform a clean reset: 1. Press and hold down the Contacts and Inbox buttons. (2 + 3) 2. While holding down these buttons, use the stylus to lightly press the Reset button on the bottom of the iPAQ Pocket PC for about two seconds. 3. A dialogue box will pop up asking for confirmation. Press the Calendar button and the unit will begin the clean reset process. iPAQ hx4700 WM2003SE Hard Reset Perform a hard reset only when you want to clear all user-installed settings, applications, and data from RAM (Random Access Memory), where data and applications you have loaded are stored. If the battery installed in your Pocket PC discharges completely, your Pocket PC will operate as if a hard reset had been performed once the battery has been recharged. CAUTION: If you perform a hard reset, y.. iPAQ hx4700 WM2003SE Soft Reset A soft reset does not erase any applications or saved data, but be sure to save any unsaved data before performing a soft reset since any unsaved data will be lost. Perform a soft reset when: ■ you want to stop all running applications ■ after installing a new application ■ if your Pocket PC “locks up” To perform a soft reset: 1. Locate the Reset button on the bottom of your Pocket PC. 2. Use th.. PInvoke SetForegroundWindow Sample Code SetForegroundWindow 메쏘드를 이용한 샘플 코드이다. 1초에 한번씩 노트패드에 "abc " 스트링을 입력을 하는 것이다. using System; using System.Diagnostics; using System.Windows.Forms; using System.Runtime.InteropServices; namespace ControlHandle { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.timer1.Interval = 1000; this.timer1.Enabled = true.. Process Class Sample Code 1 Process 클래스를 이용해서 원하는 Window(Process)의 핸들값을 얻는 샘플 코드이다. using System; using System.Diagnostics; using System.Windows.Forms; namespace ControlHandle { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.textBox1.Text = String.Empty; Process[] processes = Process.GetProcessesByName("notepad"); foreach (Process .. 이전 1 ··· 21 22 23 24 25 26 27 ··· 38 다음