이것은 앞의 예제를 약간 변형한 것이다. 2개의 Thread가 하나의 공통된 변수를 다루고 있다. 2개의 Thread가 하나의 int 변수에 발생한 난수를 더하고 있다. using System; using System.Threading; namespace SampleThread { class Program { static void Main(string[] args) { myRandom = new Random(); s = 0; Thread t1 = new Thread(new ThreadStart(method1)); t1.Start(); Thread t2 = new Thread(new ThreadStart(method2)); t2.Start(); } private static void method1() { ..
아래는 간단한 Thread 샘플 코드이다. 난수를 발생시키는 2개의 Thread가 있고, 발생한 난수만큼 Sleep 한다. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace SampleThread { class Program { static void Main(string[] args) { myRandom = new Random(); Thread t1 = new Thread(new ThreadStart(method1)); t1.Start(); Thread t2 = new Thread(new ThreadStart(method2)); t2.Star..
아래는 Extension Methods 예제이다. LINE A는 Extension Methods를 사용했고, LINE B는 Static Method를 사용했다. 둘의 선언 방법과 사용 방법을 비교해보자. Extension methods are static methods. Extension methods can only be declared in static classes. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string s = "9"; int ..
- Total
- Today
- Yesterday
- iText
- Phalanger
- WinAutomation
- 스크린캡쳐
- Microsoft
- tagREADYSTATE
- DotNetMagic
- 애드센스숨기기
- c#
- jre
- windows
- READYSTATE_COMPLETE
- Sample Code
- 유틸리티
- iTextSharp
- download.com
- .net framework
- AdSense감추기
- autohotkey
- Service pack
- 애드센스감추기
- java
- AxWebBrowser
- registry
- Regular Expressions
- ScreenHunter
- Rollback Rx
- AdSense숨기기
- Automation
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
31 |