Code (117) 썸네일형 리스트형 Process 목록 출력 샘플코드 현재 컴퓨터에서 작동 중인 process 목록을 출력해주는 샘플코드이다. using System; using System.Diagnostics; namespace ProcessTest { class Program { static void Main(string[] args) { Process[] processes = Process.GetProcesses(); foreach (Process item in processes) { Console.WriteLine(item.ToString()); } } } } AxWebBrowser.ReadyState 샘플코드 AxWebBrowser.ReadyState 상태를 체크해서, AxWebBrowser Navigate 완료 여부를 판단한다. 아래 코드와 같이 해주면 된다. while (this.axWebBrowser1.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE) { Thread.Sleep(100); Application.DoEvents(); } [C/C++] Hello World 샘플코드 #pragma once #include #include #include #include using namespace std; int main(int argc, char* argv[]); #include "Program.h" int main(int argc, char* argv[]) { cout WebBrowser.ReadyState 샘플코드 WebBrowser.Navigate 명령 이후, 웹페이지가 완전히 로딩 될 때까지 기다리게하는 예제이다. WebBrowser.ReadyState를 이용해서 완료상태를 체크한다. using System.Threading; using System.Windows.Forms; namespace MyBrowser { public partial class Form1 : Form { public Form1() { InitializeComponent(); this.webBrowser1.Navigate("http://www.tistory.com"); while (webBrowser1.ReadyState != WebBrowserReadyState.Complete) { Thread.Sleep(100); Application.. RichTextBox AutoResize 샘플코드 내용에 따라서 자동으로 크기가 변하는 RichTextBox 샘플코드이다. The key is handling the ContentsResized event on the RichTextBox (doesn't exist on a TextBox). The ContentsResizedEventArgs has a NewRectangle property which will give you the desired size. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; na.. iTextSharp 샘플코드 - Hello World iTextSharp 컴포넌트를 이용한 샘플코드이다. 가장 기본적인 예제로 Hello World 파일을 만드는 예제이다. using System; using System.IO; using iTextSharp.text; using iTextSharp.text.pdf; namespace iTextSharpSample { class Program { static void Main(string[] args) { // step 1: // Create an instance of the iTextSharp.text.Document object Document document = new Document(); // step 2: // Create a Writer that listens to this document and.. [C#] Object Initializer 사용법 샘플 코드 Object Initializer 사용법을 설명하는 샘플코드이다. using System; namespace Sample { class Program { static void Main(string[] args) { Line L1 = new Line(); Point myP1 = new Point(); myP1.X = 1; myP1.Y = 2; Point myP2 = new Point(); myP2.X = 3; myP2.Y = 4; L1.P1 = myP1; L1.P2 = myP2; Console.WriteLine(L1.ToString()); Line L2 = new Line(); Point itsP1 = new Point { X = 5, Y = 6 }; // Object Initializers Point i.. [C#] 간단한 Object Initializer 샘플 코드 Object Initializer를 이용하는 간단한 샘플코드이다. 아래에서 P1과 P2의 property에 값을 대입하는 방식을 살펴보라. using System; namespace Sample { class Program { static void Main(string[] args) { Point P1 = new Point(); P1.X = 2; P1.Y = 3; Console.WriteLine(P1.ToString()); // Object Initializers Point P2 = new Point { X = 7, Y = 8 }; Console.WriteLine(P2.ToString()); } } public class Point { int x; public int X { get { return x; .. 이전 1 ··· 6 7 8 9 10 11 12 ··· 15 다음