Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll •...
Transcript of Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll •...
![Page 1: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/1.jpg)
Microsoft W
indows Mobile
Microsoft W
indows Mobile
Dae-Ki Kang
![Page 2: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/2.jpg)
차례
•소
개(Introduction)
•설
치(Installation)
•헬
로(Hello, Smartphone! etc. in MFC of C++)
•헬
로(Hello, Smartphone! etc. in MFC of C++)
•배
포(Deployment (upload a program to a smart
device))
•GUI (GUI Programming in C#)
•C#의
개요
•C# 프
로그
래밍
실습(M
ore Serious Issues in C#)
![Page 3: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/3.jpg)
소개
[1/2]
C# 프
로그
래밍
언어
MS사
의앤
더스
헬스
버그(Anders Hejlsberg)가
고안
.NET에
최적
화된
언어
컴포
넌트
지향
프로
그래
밍언
어자
바의
단점
을보
완자
바의
단점
을보
완실
행방
법: 자
바: 인
터프
리테
이션, C#: 컴
파일
방법
자바
언어
를대
체할
수있
는언
어
C#의
특징
객체
지향
언어: 자
료추
상화
델리
게이
트와
이벤
트멀
티스
레드, 예
외처
리연
산자
중복, 제
네릭
![Page 4: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/4.jpg)
소개
[2/2]
C 계
열의
언어
C++와
자바
로부
터영
향을
받았
음.
C: 연
산자
와문
장등
기본
적인
언어
의기
능C++: 객
체지
향속
성, 연
산자
중복, 제
네릭(Generic)
자바: 예
외처
리와
스레
드
C# 언
어의
계통
도C# 언
어의
계통
도
![Page 5: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/5.jpg)
콘솔/윈
폼애
플리
케이
션콘
솔애
플리
케이
션문
자기
반명
령어
프롬
프트
환경
에서
실행
키보
드를
통해
입력, 화
면에
문자
로출
력
윈폼
애플
리케
이션
윈도
우폼
애플
리케
이션(W
indows form
s Application)의
약어
GUI를
통해
서입
출력
을수
행이
벤트
처리
방식
을통
해실
행
C# 개
발환
경SDK를
이용–
편집
기, 컴
파일
러, 실
행엔
진, 클
래스
라이
브러
리통
합개
발환
경(IDE)
Visual Studio .NET
![Page 6: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/6.jpg)
콘솔
애플
리케
이션
일반
적인
응용
프로
그램
예제
프로
그램:
[예제
1.1
–H
ello
World.cs]
usin
g S
yste
m;
clas
s H
ello
World {
pub
lic s
tatic
void
Mai
n() {
Cons
ole
.Write
Line
("H
ello
World!");
네임스페이스
실행
과정C
ons
ole
.Write
Line
("H
ello
World!");
} }
실행
결과
:H
ello
World!
출력메소드
C:\temp>cscHelloWorld.cs
C:\temp>HelloWorld
Hello World!
![Page 7: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/7.jpg)
윈폼
애플
리케
이션
윈도
우응
용프
로그
램예
제프
로그
램:
[예제
1.2
–W
inFo
rmApp.cs]
usin
g S
yste
m;
usin
g S
yste
m.W
indow
s.Fo
rms;
clas
s W
inFo
rmApp : F
orm
{
Win
Form
App() {
Win
Form
App() {
Text
= "
Hel
lo W
orld!";
} pub
lic s
tatic
void
Mai
n() {
Applic
atio
n.Run
(new
Win
Form
App());
} }
실행
결과
:
Text
프로
퍼티
타이
틀바
에출
력
![Page 8: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/8.jpg)
C# 프
로그
램실
행과
정컴
파일
과정
csc: C# compiler
실행
시스
템CLR –Common Language Runtime
실행
과정
실행
과정
![Page 9: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/9.jpg)
기본
특징
[1/4]
•자
료형
▫변
수나
상수
가가
질수
있는
값과
연산
의종
류를
결정
▫C#의
자료
형�
값형(value type)
�참
조형(reference type)
▫숫
자형
정수
형▫
숫자
형�
정수
형�signed –sbyte, short, int, long
�unsigned –byte, ushort, uint, ulong
�실
수형–float, double, decimal
•연
산자
▫표
준C 언
어와
유사
▫형
검사
연산
자(type testing operator)
�is –
호환
가능
한지
를검
사�as –
지정
한형
으로
변환
![Page 10: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/10.jpg)
기본
특징
[2/4]
배열
형같
은형
을갖
는여
러개
의값
을저
장할
수있
는자
료구
조.
배열
변수
선언
배열
을가
리키
는참
조변
수
int[]
vector;
short[,]matrix;
long[][]arrayOfArray;
object[]myArray1, myArray2;
![Page 11: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/11.jpg)
기본
특징
[3/4]
배열
객체
생성
new 연
산자
vector = new int[100];
matrix = new short[10,100];
myArray1 = new Point[3];
배열
사용
for (int i=0; i<vector.Length; i++)
vector[i] = i;
![Page 12: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/12.jpg)
기본
특징
[4/4]
스트
링C#에
서스
트링
은객
체System
.String
클래
스의
객체
C#의string 형
은String 클
래스
의alias
스트
링상
수이
중인
용부
호(”)로
묶인
문자
들의
나열(예
: ”I am a string.”)
스트
링초
기화
스트
링초
기화
스트
링연
결+ 연
산자: concatenation operator
string s = ”Hello”;
string s = new string(”Hello”);
string s = ”Hello”;
s += ” World”;
=> s: Hello World
![Page 13: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/13.jpg)
주요
특징
클래
스프
로퍼
티연
산자
중복
연산
자중
복델
리게
이트
이벤
트스
레드
제네
릭
![Page 14: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/14.jpg)
클래
스클
래스
와객
체프
로그
래밍
언어
적인
측면
에서
객체
자료
형또
는객
체클
래스
클래
스의
구성–
클래
스멤
버필
드계
통–
상수
정의, 필
드, 이
벤트
메소
드계
통–
메소
드, 생
성자, 소
멸자,
프로
퍼티, 인
덱서, 연
산자
중복
자동
차출
발!!!
![Page 15: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/15.jpg)
클래
스의
설계
•객
체의
속성
과행
위를
결정
▫속
성–
필드
계통
▫행
위–
메소
드계
통class CoffeeMaker{
public boolonState;
public void StartCoffeeMaker() {
CoffeeMaker
클래
스를
이용
하여StartCoffeeMaker() 메
소드
를호
출하
여보
시오.
public void StartCoffeeMaker() {
if (onState== true)
Console.WriteLine("The CoffeMakeris already on");
else
onState= true;
Console.WriteLine("The CoffeMakeris now on");
}
}
![Page 16: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/16.jpg)
프로
퍼티
[1/2]
프로
퍼티
의개
념클
래스
의private 필
드를
형식
적으
로다
루는
일종
의메
소드.
값을
지정
하는
셋-접
근자
와값
을참
조하
는겟-접
근자
로구
성.
프로
퍼티
의정
의형
태
[property-modifiers] returnTypePropertyName{
[property-modifiers] returnTypePropertyName{
get{
// get-accessorbody
} set{ // set-accessorbody
}
}
![Page 17: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/17.jpg)
프로
퍼티
[2/2]
프로
퍼티
의동
작필
드처
럼사
용되
지만, 메
소드
처럼
동작.
배정
문의
왼쪽
에서
사용
되면
셋-접
근자
호출.
배정
문의
왼쪽
에서
사용
되면
셋-접
근자
호출.
배정
문의
오른
쪽에
서사
용되
면겟-접
근자
호출.
예제1.5
Text p. 28
Value
지정
어의
의미?
![Page 18: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/18.jpg)
연산
자중
복연
산자
중복
의의
미시
스템
에서
제공
한연
산자
를재
정의
하는
것.
클래
스만
을위
한연
산자
로써
자료
추상
화가
가능.
시스
템에
서제
공한
연산
자처
럼사
용가
능
문법
적인
규칙
은변
경불
가(연
산순
위나
결합
법칙
등).
연산
자중
복정
의형
태
예제1.6 –
교과
서29쪽
public static [extern] returnTypeoperator op(parameter1 [, parameter2]) {
// ... operator overloading body ...
}
![Page 19: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/19.jpg)
델리
게이
트•
델리
게이
트(delegate)는
메소
드참
조기
법▫
객체
지향
적특
징이
반영
된메
소드
포인
터•
이벤
트와
스레
드를
처리
하기
위한
방법
론•
선언
형태:
[modifiers] delegate returnTypeDelegateName(parameterList);
•델
리게
이트
프로
그래
밍순
서①
메소
드정
의②
델리
게이
트정
의�
델리
게이
트형
태와
연결
될메
소드
의형
태가
일치
�반
환형, 매
개변
수의
개수
와형
③델
리게
이트
객체
생성
④델
리게
이트
객체
에메
소드
연결
⑤델
리게
이트
를통
해메
소드
호출
![Page 20: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/20.jpg)
이벤
트[1/2]
이벤
트(event)
사용
자행
동에
의해
발생
하는
사건.
어떤
사건
이발
생한
것을
알리
기위
해보
내는
메시
지로
간주.
C#에
서는
델리
게이
트를
이용
하여
이벤
트를
처리.
이벤
트정
의형
태이
벤트
정의
형태
이벤
트-주
도프
로그
래밍(event-driven programming)
이벤
트와
이벤
트처
리기
를통
하여
객체
에발
생한
사건
을다
른객
체에
통지
하고
그에
대한
행위
를처
리하
도록
시키
는구
조를
가짐
각이
벤트
에따
른작
업을
독립
적으
로기
술프
로그
램의
구조
가체
계적/구
조적
이며
복잡
도를
줄일
수있
음
[event-modifier] event DelegateTypeEventName;
![Page 21: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/21.jpg)
이벤
트[2/2]
이벤
트프
로그
래밍
순서
①이
벤트
처리
기를
작성
②이
벤트
처리
기의
형태
와일
치하
는델
리게
이트
를정
의(또
는System
.EventHandler델
리게
이트
를사
용)
③델
리게
이트
를이
용하
여이
벤트
를선
언(미
리정
의된
이벤
트인
경우
에는
생략)
(미리
정의
된이
벤트
인경
우에
는생
략)
④이
벤트
에이
벤트
처리
기를
등록
⑤이
벤트
를발
생(미
리정
의된
이벤
트는
사용
자행
동에
의해
이벤
트가
발생)
이벤
트가
발생
되면
등록
된메
소드
가호
출되
어이
벤트
를처
리미
리정
의된
이벤
트발
생은
사용
자의
행동
에의
해서
발생
사용
자정
의이
벤트
인경
우에
는명
시적
으로
델리
게이
트객
체를
호출
함으
로써
이벤
트처
리기
를작
동
![Page 22: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/22.jpg)
[예제
1.8] EventApp.cs
[예제
1.8
-Ev
entA
pp.cs]
usin
g S
yste
m;
usin
g S
yste
m.W
indow
s.Fo
rms;
clas
s Ev
entA
pp :
Form
{
pub
lic E
vent
App() {
this.C
lick
+= n
ew E
vent
Han
dle
r(Clic
kEve
nt);
//
④이
벤트
처리
기등
록} vo
id C
lickE
vent
(obje
ct, s
ender
, Eve
nt a
rgs)
{
// ①
이벤
트처
리기
작성
Mes
sageB
ox.Sh
ow
("H
ello
world");
미리정의된이벤트를위한
델리게이트
Mes
sageB
ox.Sh
ow
("H
ello
world");
} pub
lic s
tatic
void
Mai
n() {
Applic
atio
n.Run
(new
Eve
ntAPP
());
} }
실행
결과
:
![Page 23: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/23.jpg)
스레
드•
스레
드의
기본
개념
▫순
차프
로그
램과
유사
하게
시작, 실
행, 종
료의
순서
를가
짐▫
실행
되는
동안
에한
시점
에서
단일
실행
점을
가짐
▫프
로그
램내
에서
만실
행가
능�
스레
드는
프로
그램
내부
에있
는제
어의
단일
순차
흐름
(single sequential flow of control)
(single sequential flow of control)
�단
일스
레드
개념
은순
차프
로그
램과
유사
•멀
티스
레드
시스
템▫
스레
드가
하나
의프
로그
램내
에여
러개
존재
•스
레드
프로
그래
밍의
순서
①스
레드
몸체
에해
당하
는메
소드
를작
성②
작성
된메
소드
를ThreadStart
델리
게이
트에
연결
③생
성된
델리
게이
트를
이용
하여
스레
드객
체를
생성
④스
레드
의실
행을
시작(Start() 메
소드
를호
출)
![Page 24: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/24.jpg)
[예제
1.9] ThreadApp.cs
[예제
1.9
–Thr
eadApp.cs]
usin
g S
yste
m;
usin
g S
yste
m.T
hrea
din
g;
//
반드
시포
함!!!
cl
ass
Thre
adApp {
stat
ic v
oid
Thr
eadBo
dy(
) {
/
/ --
-①
Cons
ole
.Write
Line
("In
the
thr
ead b
ody
…");
} pub
lic s
tatic
void
Mai
n() {
Thre
adSt
art
ts =
new
Thr
eadSt
art(Th
read
Body)
;
/
/ --
-②
Thre
adSt
art
ts =
new
Thr
eadSt
art(Th
read
Body)
;
/
/ --
-②
Thre
ad t =
new
Thr
ead(ts)
;
/
/ --
-③
Cons
ole
.Write
Line
("**
* St
art
of M
ain"
); t.S
tart
();
//
---
④Cons
ole
.Write
Line
("**
* En
d o
f M
ain"
); }
}
실행
결과
:**
* St
art of
Mai
n **
* En
d o
f M
ain
In the
thr
ead b
ody
…
![Page 25: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/25.jpg)
제네
릭•
제네
릭의
의미
▫자
료형
을매
개변
수로
가질
수있
는개
념▫C++의
템플
릿과
유사
한개
념•
제네
릭단
위▫
클래
스, 구
조체, 인
터페
이스, 메
소드
•제
네릭
클래
스▫
범용
클래
스또
는포
괄클
래스
▫범
용클
래스
또는
포괄
클래
스▫
형매
개변
수(type parameter) -<> 안
에기
술▫
예:class Stack<StackType> {
private StackType[] stack = new StackType[100];
// ...
public void Push(StackTypeelement) { /* ... */ }
public StackTypePop() { /* ... */ }
} Stack<int> stk1 = new Stack<int>();
// 정
수형
스택
Stack<double> stk2 = new Stack<double>(); // 실
수형
스택
![Page 26: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/26.jpg)
.NET 프
레임
워크
소개
공통
언어
스펙
CLS: Common Language Specification
공통
자료
형시
스템
공통
자료
형시
스템
CTS: Common Type System
실행
모델
공통
언어
런타
임CLR: Common Language Runtime
![Page 27: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/27.jpg)
.NET 프
레임
워크
.NET 프
레임
워크(Framework)
마이
크로
소프
트사
가개
발한
프로
그램
개발
환경.
.NET 프
레임
워크
의구
조도
현재
지원
언어
C#, Visual Basic .NET, Managed C++, J#
CLS 만
족하
는언
어
![Page 28: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/28.jpg)
공통
언어
스펙
언어
의상
호운
용성
을지
원하
기위
한스
펙CLS Common Language Specification
CLS를
만족
하는
언어
를“공
통언
어”라
부름
C#, Visual Basic .NET, J#, Managed C++
CLS를
만족
하면
서로
다른
언어
에서
만들
어진
라이
브러
리를
공유
할수
있다.
기본
클래
스라
이브
러리
.NET 프
레임
워크
에서
제공
BCL : Base Class Library
CLS를
만족
하면BCL을
사용
할수
있다.
![Page 29: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/29.jpg)
공통
자료
형시
스템
다른
언어
와상
호운
용성
에필
요한
공통
의자
료형
CTS 형
과C# 자
료형
관계
CTS 자
료형
의미
C# 자
료형
System.Object
객체
형object
System.String
스트
링형
string
System.Sbyte
부호
있는
바이
트형(-128~127)
sbyte
System.Byte
바이
트형(0
~255)
byte
System.Byte
바이
트형(0
~255)
byte
System.Int16
16비
트정
수형
short
System.Uint16
16비
트부
호없
는정
수형
ushort
System.Int32
32비
트정
수형
int
System.Uint32
32비
트부
호없
는정
수형
uint
System.Int64
64비
트정
수형
long
System.Uint64
64비
트부
호없
는정
수형
ulong
System.Char
문자
형char
System.Single
단일
정밀
도실
수형
float
System.Double
이중
정밀
도실
수형
double
System.Boolean
부울
형bool
System.Decimal
10진
수형
decimal
![Page 30: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/30.jpg)
실행
모델
컴파
일단
계C# Compiler
실행
단계
Common Language Runtime
Common Language Runtime
JIT 방법에의해실행
![Page 31: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/31.jpg)
어셈
블리
와역
어셈
블리
과정
•어
셈블
리과
정▫*.il=�
*.exe or *.dll
•역
어셈
블리
과정
▫*.exe or *.dll =�
*.il
•IL 파
일▫
텍스
트형
태로
된중
간언
어파
일▫
컴파
일된
코드
를확
인할
수있
음▫
더나
아가
디버
깅하
는데
사용
할수
있음.
![Page 32: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/32.jpg)
공통
언어
런타
임•.NET 프
레임
워크
의실
행시
스템
•자
바의JVM
과동
일한
기능
을담
당•
실행
환경
을포
함▫
필수
적인
실행
환경3가
지컴
포넌
트�
메모
리관
리기
�예
외처
리기
�스
레드
지원
�스
레드
지원
•공
통언
어런
타임
컴포
넌트
![Page 33: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/33.jpg)
외부
링크
들•.NET Framework
▫http://en.wikipedia.org/wiki/.NET_Framework
•List of CLI languages
▫http://en.wikipedia.org/wiki/List_of_.NET_lang
uages
uages
![Page 34: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/34.jpg)
차례
•소
개(Introduction)
•설
치(Installation)
•헬
로(Hello, Smartphone! etc. in MFC of C++)
•헬
로(Hello, Smartphone! etc. in MFC of C++)
•배
포(Deployment (upload a program to a smart
device))
•GUI (GUI Programming in C#)
•C#의
개요
•C# 프
로그
래밍
실습(M
ore Serious Issues in C#)
![Page 35: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/35.jpg)
파일
읽기
(Files)
•파
일을
읽어
서첫
번째
라인
을레
이블
로보
인다
1.public Form
1()
2.
{3.
InitializeComponent();
4.
ReadFileToLabel();
5.
}
6.
private void ReadFileToLabel()
7.
{8.
StreamReadersr=
File.OpenText(@"\windows\pocketmsn.htm");
9.
string s = "";
10.
s = sr.ReadLine();
11.
this.label1.Text = s;
12.
}
![Page 36: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/36.jpg)
![Page 37: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/37.jpg)
데이
터베
이스
(Databases)
•응
용프
로그
램의
데이
터와
세팅
을.NET 컴
팩트
프레
임워
크를
이용
하여
윈도
우모
바일
기반
의스
마트
폰응
용프
로그
램에
저장
•http://m
sdn.microsoft.com/en-
us/library/m
s839432.aspx
•XML 포
맷의
데이
터▫XML Schem
a
▫XML files
▫DataSet
▫SqlCommand
•근
미래–LINQ 기
술
![Page 38: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/38.jpg)
프로
세스
(Processes)
•Visual Studio.NET 2008 and .NET Compact
Framework 2.0 or higher
1.private void menuItem
1_Click(object sender,
EventArgs e)
EventArgs e)
2.
{
3.
Process.Start(@
"IExplore.exe",
@"\windows\pocketmsn.htm");
4.
}
![Page 39: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/39.jpg)
![Page 40: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/40.jpg)
![Page 41: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/41.jpg)
통지(Notifications (in a m
anaged
system))
•.NET 컴
팩트
프레
임워
크에
서고
급P/Invoke
(Platform
Invoke) –
http://m
sdn.microsoft.com/en-
us/library/aa446529.aspx
us/library/aa446529.aspx
•CeSetUserNotificationEx API에
대한Wrapper
를만
듦•P/Invoke
를이
용하
여그wrapper (DLL 형
태) 와
통신
함
![Page 42: Microsoft Windows Mobilekowon.dongseo.ac.kr/~dkkang/Mobile2009Spring/Ch03.pdf · *.exe or *.dll • 역숦센벂리 과정 *.exe or *.dll = *.il • IL 파일 텍솔트 형태로](https://reader033.fdocuments.net/reader033/viewer/2022052004/601745a757338a3ced375447/html5/thumbnails/42.jpg)
요약
및심
화이
슈들
•Reference:
▫C#.NET MOBILE PROGRAMMING –
안원
국▫Programming Windows CE.NET-Douglas Boling
▫Programming Windows CE.NET-Douglas Boling
•Windows CE 네
트워
킹•
디바
이스
간통
신•
데스
크탑
과연
결•
게임API