SlideShare a Scribd company logo
1 of 111
Download to read offline
ก Fก F WebCam ˈ ก F

ก

ก

F
F

F

ˈ F

ก
ก
ก

ก
ก

ʽ F

F

ก

ก
ก
ก
ก
ก F

. .2553

. . 2553

F
MODIFICATION OF WEBCAM CAMERA TO INTERNET
CLOSED-CIRCUIT TELEVISION

Mr. Sittisak Phumhirun
Mr. Panu Rungsawang

Project Report Submitted in Partial Fulfillment of the Requirements
for the Bachelor s Degree of Science in
Information and Production Technology Management
Department of Information and Production Technology Management
College of Industrial Technology
King Mongkut s University of Technology North Bangkok
2010
F

F

ก

ʾก

:ก
:

ก Fก F WebCam ˈ ก F
ก
F
F F
F
ก F

F :
:ก
:ก
: 2552

F
ก
ก

ก

ˈ F

กF
ก

ก

ก

F

ก

.................................................................. F
(
F
)
ก

F

ก
ก

ก
F

ʽ F

F

....................................................................
(
F
F
F
)

ก

..................................................................... ก
(
F
ก F)

ก

..................................................................... ก
(
F
)

ก

..................................................................... ก
(
F
F ก
F)

ก

ก

ก
Project Title
By

: Modification of Webcam Camera to Internet Closed-Circuit Television
: Mr. Sittisak Phumhirun
Mr. Panu Rungsawang
Project Advisors : Ms. Supitcha Cheevapruk
Ms. Thitima Asavapromthada
Major Field
: Information and Production Technology Management
Department
: Information and Production Technology Management
Academic Year : 2009

Accepted by the College of Industrial Technology, King Mongkut s University of Technology
North Bangkok in Partial Fulfillment of the Requirements for the Bachelor s Degree.

......................................................... Director of College of Industrial Technology
(Assoc.Prof. Sivilai Thanormsuay)
Project Committee
.................................................................... Chairperson
(Assoc. Prof. Anan Wetwatana)
.................................................................... Member
(Ms. Supitcha Cheevapruk)
.................................................................... Member
(Ms. Thitima Asavapromthada)
.................................................................... Member
(Ms. Hathairat Ketmaneechirat)
F

F

ก

ʾก

: ก
:
F :
: ก
:ก
: 2552

ก

ก Fก F WebCam ˈ ก F
ก
F
F F
F
ก F
F
ก
ก

ʽ F

F

ก
ก

F

ˆ
F

F

ก F

ʽ

F F

F

F

ก ก
ก
F
F
F ก F WebCam
F
F
ˈ ก
F
ก
ˈ ก F
ʽ
ก ก F ก
ก F WebCam
F
F
F
F
F
F
ก
F
F ก ก F
ก
ก
ก
ก F
User
F
on demand F Admin ˈ F ก F
ก ก
ʽ F
F
F
F ก
F
ก ก
F
ก F
F F

F
ก

F

F
F

ก F ˈ ก F
ʽ
Fก F F
ก F
Fก F
ก
ก Visual Basic ก
F ก
F
F
Real time (
ˆ
F User
F
10 x 10
ก
F

F
WebCam
Fก
Fก ก F
ก
F
)

ก
Project Title
By

: Modification of Webcam Camera to Internet Closed-Circuit Television
: Mr. Sittisak Phumhirun
Mr. Panu Rungsawang
Project Advisors : Ms. Supitcha Cheevapruk
Ms. Thitima Asavapromthada
Major Field
: Information and Production Technology Management
Department
: Information and Production Technology Management
Academic Year : 2009

Abstract

Nowadays closed circuit televisions that are popularly used costs very high. Some of them
have no capacity to let users read through the internet system. If the users prefer to read
the previous incidents, there is restriction. As a result, this study was aimed to modify a Webcam
camera to function as a closed circuit television linked with the internet system that could be used
effectively based on its details or aspects in an appropriate area. A Visual Basic program was
designed and developed to be connected to the camera with the connection of the ports between
a various networks for the users to read both real-time incidents and those previous one
on demand. The administration section was responsible for the users application.
The result of this study showed that the developed camera had the capacity to record
the incidents though the internet system very clearly in the room with the dimension of 10x10
meters. Moreover, the users could read the previous incidents effectively as needed.
ก ก

F
F

F

FF

F F

ˈ
F

ก

F F
ก F

ก

F

F

F

F

F ก
ก

F

F
F F

ก
ก F
F

F

F กF
ˈ

F ˈ
ก

ก F
F
F

F

F
ก

F ก

F

F

ก

ก F

ก

F
ก

ก

F

F

ก

F

F
F

F Fก

ก

F

F
F
F
F
F

ก

ก ก

ก

1
1.1
1.2
1.3
1.4
1.5
2
2.1
2.2
2.3
2.4
2.5
2.6
2.7
3

ˈ

ˆ
F

ก

F

ก

ก

F

ก

ก
F

ก F
F
ʽ (CCTV)
(Web Camera)
F
F
F (Server)
DNS (Domain Name Service)
ก Microsoft Visual Basic
ก F

ก
3.1 ก
3.2 ก
3.3 ก

F
F
ก

ก

ก
ก F

1
1
2
2
2
3
4
4
6
7
17
21
25
35
37
37
38
45
( F)

3.4 ก
3.5 ก
4

ก
4.1
4.2

5

F

ก
ก

ก
F

F

F
ก Fก F WebCam

ก
ก

ก
5.1
5.2 F

ก

ก

F

F
46
49
57
57
62
69
69
69

ก

ก

70

ก

71
72
78

กก ก
ก
F

ก Appserv
ก Cam Server
2-1
2-2
2-3
3-1
4-1
4-2
F

F

IEEE
ก
F (Attribute)
ก
ก
ก
ก

F

IEEE 802.3
Ethernet
ก
F ก F A (3 F ก )
F ก F B (5 F ก )
F

F

F
15
16
17
45
65
67
2-1 ก F
ʽ
2-2 ก F
ʽ
F
2-3 Web Camera
2-4
F
LAN
2-5
F
MAN
2-6
F
WAN
2-7 ก
F
Peer To Peer
2-8 ก
F
Client Server
2-9 ก
F
F
Bus
2-10 ก
F
F
Ring
2-11 ก
F
F
Star
2-12 ก
F
F
Hybrid
2-13
F ก
F
2-14
F ก
F F
2-15 ก
ก
2-16 ก
F
2-17 ก F F F
2-18
ก F
User F
Internet
F
2-19 ก
Domain Name Service
2-20
F
ก
F
F
ADSL
2-21 ก
F Dynamic DNS Client Zyxel P660R
2-22 ก
ก Dynamic DNS Client
2-23
ก Fก F
2-24
F
VB 6.0
2-25
ก F ก F New Project
2-26 ก
F Standard
2-27 ก
F Edit

Lan

F
4
5
6
8
9
9
10
10
11
11
12
12
13
13
14
14
15
20
21
22
23
24
27
28
29
29
30
( F)

2-28 ก
F Debug
2-29 ก
F Form Editor
2-30
Control
2-31
F F
VBIDE
2-32 Project Explorer
ก F
2-33 F F
Alphabetic
2-34 F F Form Layout
2-35 F F Immediate
2-36
F
VBIDE
MDI
2-37
F
VBIDE
SDI
3-1
Flow Chart
ก
F
F
3-2 ก
F
F
F F
3-3 Context Diagram
3-4 Data Flow Diagram
3-5 Data Flow Diagram Level 1 Process 1 (ก F F
)
3-6 Data Flow Diagram Level 1 Process 2 (ก
F
ˆ
)
3-7 Data Flow Diagram Level 1 Process 3 (ก F
F
)
3-8 Data Flow Diagram Level 1 Process 4 (ก กF / F )
3-9 Data Flow Diagram Level 1 Process 5 (ก
ก F
ก F)
3-10 F
ก
ก
3-11 F
ก User
3-12 F Login F F
3-13 F
ˆ
(Real time)
3-14 F
FF
3-15 F
FF
ก ก
3-16 ก
F
ก
ก
3-17 ก
ก
F
ก User

F
30
30
31
32
32
33
34
34
35
35
39
40
41
42
43
43
44
44
45
46
46
47
47
48
48
49
49
( F)

3-18
3-19
3-20
3-21
3-22
3-23
3-24
3-25
3-26
3-27
3-28
3-29
4-1
4-2
4-3
4-4
4-5
4-6
4-7
4-8
4-9
4-10
4-11
4-12

ก
ก
ก

F
F

FF

F
F

F ˆ

ก

ก ก
F
F
F
F
F
F
F

F

F

F

F

ก

(Server)
ก

Folder
F
F

ก User
F
F
F

ˆ

ก
ก

(Real Time)

F
F

F

F

Device
Video Path Video Limit
F
ก User
F F http://192.168.0.253/webcam/login
ก
F F
ก
F
F
ก
F
Fก F
F
ก F F
F ˆˉ Client
F
F
ก
F
ก
F
F
F ก F A (3 F ก ) ก B (5 F
F
F
3x7

ก

)

F
50
50
51
52
52
53
53
54
54
55
55
56
57
58
59
59
60
60
61
61
62
62
63
64
1

1.1
ˆ

ˈ

ˆ
ก F

ʽ F ก F
F กF
F F
F F ก
ก F
ʽ F ก
ก
ก
F ก
F F
F ก F
F FF
ก F
ʽ F
F
ก
F
F F
ก F
F ก
ก
ก
ก F
กก F
ʽ
ก ก
ก F
ʽ F
F
ก
ก
ก F
ก
F
F
ก
F
F
ก F
ก F
ก F WebCam
ˈ ก F
ʽ
F
ก F WebCam
ˆ
(CCTV) F F ก F
ˈ
Fก F
WebCam ก
F
F
กก F ก F
F
F
F
F
ก Fก F
ก F
F
F
F ก ก
F F
ก F
F
ก F ˆ
F ก
F F
ก F ก
F FF
F

FF
ˈ
F F

ก

ก

ˆ

F

ก
ก
ก F
ʽ F F
F ก

F
ˆ

ʽ

Fก F
F

F

ก

F
F
ʽ
F
ʽ
ʽ
ก
ก

ก

F

F

ˈ

F

ˈ ก
F
กFก F
Fก ก F
Fก

F
F

ก F F F
ʽ

Fก
F F
ก F
ʽ

ก

F

ก F WebCam
F
ก F
F F F
F
ก F ก
F F
F
F
2
1.2

F ก
ก ก
ก ก
ก
ก
F

1.2.1
1.2.2
F
1.2.3
1.2.4
1.2.5
1.3

ก

ก
ก

ก

ก Visual Basic ก
ก F WebCam
ก Macromedia Dreamweaver ก

ก
F
F

F

ก F

F

F

ʽ

F
Fก F WebCam F

F

ก

1.3.1 ก

IP Fก ก F
F
F ก
F ก
ก
Server
F
Dynamic DNS ก
F
1.3.2 ก F
ก ก ก
Fก F
Admin
User F User
F
F
Real Time
On Demand F F F
F
F กF
F F Admin
F
ˈ F
ก
F
ก F
ก
ก
กF
F
F
ก
ก
ก ก F
F
F F
F กF F
ก
กก F
ʽ
Real Time
On Demand F ก ˈ
F
กF ก
ก
ˈ ก
ก
Fก
F
F F
1.3.3
1.3.4
1.3.5
ก

1.4

ก F
ก
ก
Host Web Server
ก F
ก
ก F
ก
ก
F
ก F
ก1 . F
60 MB. F 1 ก
ก ก F
F 1 GB.

ก
1.4.1 DNS ( Domain Name Service ) F
F www.company.com
กF
F
F (DNS Server)

F2ก F
ก F
F 1 GB.
F
F 24 .
F
1.44 GB.
Server

ก F
203.156.24.52

F ก F
3
1.4.2

ก
F

ก
F

F

Fก

F

(Dynamic DNS) ˈ
F
F
F
F F ก

ก

ก
F

ก

F

ก

1.4.3
F

(WebCam F
ก Web Camera) ก F
F
F
F
ก
ˈ ก F F F (
)
F
ก
F
F
F ˆˉ
F
F
ก F ˆ
F ก
F F
F
F
1.4.4 VPN (Virtual Private Network) F
F
F
ก
(WAN - Wide Area
Network) F
F
ก ก
ก
F
VPN ก
F
F
ก
F
F
F
ก F
F
Leased line
1.5

F

1.5.1
ก F ก
ก F CCTV
1.5.2 F
Server
1.5.3
ก
F

F

F

F

ก

F

ˈ F

ก
ก

ก

F ก
DynDNS (Dynamic DNS) ก
F
F F

F

F ก

F

ก
Fก

F ก F
F

F
F

Internet ก
ก

ก
2
ก
ก
F

F

ˈ F

F
F

F

F

ก

F
2.1
F
ʽ (CCTV)
2.2
(Web Camera)
2.3
F
2.4 F
F (Server)
2.5 DNS (Domain Name Service)
2.6
ก Microsoft Visual Basic
2.7
ก F

2.1

F
ʽ (CCTV)
ก F
ʽ (CCTV) F
ก Closed-Circuit Television
ก
ˈ
ก F
ก F
Point to Point
F
ʽ F
ก F
ˆ
2 ก
2.1.1
ก F
Fก (Fixed Camera)

2-1 ก F

ʽ

F
F ก

ก
ก

F
5
2.1.2

F (Moving Camera)

2-2 ก F
2.1.2.1
Fก F

ก F
F
กF

10
F

ʽ

F

F (Pan & Tilt unit) ˈ ก F
F ก F
Fก Pan & Tilt unit
กF
F
ก F
กF F
ก
F
ก ก F
F
F F ก F F ˈ
F ก
F
ก ก
ก ก
ˈ F ก F F
F ก
F
F ก

F
ˈ
F
F
Pan & Tilt unit
F
F
Fก
F กก F
ก
F F F ก
F
F
ก F ก
2.1.2.2
F
F (Zoom Lens) ˈ
F
F
(
ก )
F
Fก ก F
Pan & Tilt unit F
ก ˈ
ก
F
F ก F Motorized Zoom Lens ก
ก F Motorized Zoom Lens
ก F
ก
F
F Motorized Zoom Lens
ก F ก F
F F ก F Motorized Zoom Lens
ก F ก F 6 - 35 . . (6 F ) F ˈ
F
ก
กF
F ก
F
ก ก
F Motorized Zoom Lens
ก
ก
F 6 - 60 . . (10 F ) F
ก
F ก
F
F ก
ก
F Motorized Zoom Lens
ก ก
F 6-123 . . (21 F ) ˈ F
(Available online at http://www.matcom.co.th/ contents.php?id=300.htm, 2008)
6
2.2

(Web camera)

2-3 Web Camera
2.2.1
F
F

F
ก Fก F

ก

F
F

ก

ก ก
ก

F
F

F
F

ก

ก F ก

F

2.2.1.1
ก ˈ
ˈ ก F

F
F

ก F
ก

ก ก F
ก
FF F

F
F
ก F

F ˈ
ก F
ก

F ˈ
ก
F Fก ก F
ก
2.2.1.2 F
ก F
F
F ก
ก F
F
F
ก
3
ก F Fก ก
F
3
ˆ
F
F
ก
ก F
F
ก ก
F F ก
ก F
ก
ก
F
F
F
ก
ก F F F ˈ F ก ก F
F
2.2.1.3 F
F
F ก F
F
F2
CCD
CMOS F
Fก ก
ก CMOS
ก
F
CMOS ก
ก F 2
F ก
Color CMOS Censor
ก
F 110,000 ก ( 367 x 291 ) F
VGA Color CMOS Censor F
ก F 350,000 ก ( 655 x 493)

ก
F
ˈ F
ˈ
4
F
FF

ก
ก
CLF
7
ก ก F
CCD
ˈ
ก

ก

F

F

F

F ก F
F CMOS
2.2.1.4 F
ก
F
F ˈ
F
USB
F ก F
F
F
F ก
F F
view.php, 2008)
2.3

F
F
USB
Fก

CMOS
กF

F
noise F ก

ก
F
ก F
ˆ
Fก ˈ
F 1.1 Fก
F 2.0
F
WiFi
Wireless
F
(Available online at http://www.tteen.net/

F
2.3.1

F
F ก

F
F

F

FF F
F ก F

F
F
F

F

ก F
F

F
ก

ก F F

F

F
ก

ก

F ก F
F ก F
F
ˈ
LAN
F
ก
ก
F

F
ก
F
F ก
ก F Home Network
F
F
(Local Area Network)
FF
F F
ˈ
F
ก
F
ก F
Fก
F
ก
ก F
FF F
F
2.3.1.1 ก F
ก F ก
ก F ก F F
F
FF ก
ก F
F
ก
F
F
F F
F
ก
F FF
F F
F
( ก ก ˈ
F
)
2.3.1.2 ก
F F
F ก
ˈ
F F ก
F
F F
F ก
ก ก
F
F F
ก
F F
ก Fก F
ก
F F
ˆ
ก
F
ก F ก F
ก
ก F
ก F
F กF ก
ก F
2.3.1.3 ก
F
F
F ˈ
F
F
ก
F
ก
F ˈ
F F F
ก
ก F F
กF F
F Home Network
Home
Office ก
F ก ก
8
2.3.1.4 ก
F

F
F

F

F
F ก

F

F ก

F ก

F ก
ˆ

F ADSL
2.3.2

F

ก F ก

F
FF

F Fก
ˈ F
F
F F

ก F ก
ก
ก F F
F ก
F ก
1
Fก

ˈ

ก

Fก
F F

F

ก
F ก

F

F

ก

ก
F

ˈ

ก
F
F2
F ก
F F
ก F ก F
F F
F
F
ˈ 3
F ก
2.3.2.1 LAN (Local Area Network)
F
F
ก ˈ
ก F F F
ก F
ก
ˈ
F
F
ก
ก F
F
F ก 2-3 ก
ก
F
F F
F
ก
ก
Fก F F ก
F ก ก F
ก F ก ก F
ก
F
F ก
ก - F F
ก
ก F
F LAN ก
ก F ก
3 ก
- F F
ก
F
Ingle Building LAN ˈ ก
F
ก F F
ก F
F
Multiple building LAN ˈ ก
F
F
F
F ก F Backbone
2-4

2-4

F

LAN
9
2.3.2.2 MAN (Metropolitan Area Network)
F
F LAN
F
Fก F F
F
F
ก
ก F ก ก - F F
F
F
(Cable television) F
F
F ก F
F
(Switching element)
F
ก F

F

2-5

(

ก

F ก

F ก

F

F ก Fก
F ก F
ก

ˆ
F

MAN

2.3.2.3 WAN (Wide Area Network)
F
ˈ ก
ก
F
ˈ
ก F
F ก กF
F
F (Host Computer)
F
F ก กF F F
ˈ
ก ก F
F
F
F ก
F F
F
F ก - F F
F
F F
กก
F F
F WAN ก F
ก F
F
(Transmission line)
ก F
F
(Switching elements)
F, 2551 : 174-178)

2-6

F

WAN
10
2.3.3

F

2.3.3.1 Peer To Peer ˈ
F ก
F
F
ก
ก
F F
F
F
F
F F ก
Peer To Peer ก
F (Distributed System)
ก
ก F
F Fก
F
ˆ
ก ก
ก F
ˈ
ก F ก F
F
F
ก
Peer To Peer Windows for Workgroup Personal Netware

2-7 ก

F

2.3.3.2 Client - Server ˈ
ก
Fก
F

ก

F F
F
F

F
F

ก

ก F
ก

F
F

2-8 ก

Peer To Peer
Distributed Processing
ก
F
F
Fก
F
F
F ก Fก
ก
F F ก
F
F F
F
F F
Fก

F

F

F

Client Server
11
2.3.4

ก

F

2.3.4.1
F

Bus ก
F ก

F
ก

ˈ Node
(Node C) F F F
Node C F F
F
F

F
F
F

ก
F
IBM ก ก ˈ
IBM ก

F

F

Ring ก
F
ก F F
F
กF
F F
F F
F Token Ring
F

F
F
F F

Fก

F

2-9 ก
2.3.4.2

F LAN Topology
ก1 F
F
ก F
(Node A) F ก
Node C

Bus

ˈ ก

F

ก
ˆ
F
F

F

ก
ˈ ก

F

Ring ก
F F
F

ก F

2-10 ก

ก

F

Ring

F

F F
F ก
ก
12
2.3.4.3
Star ก
F
F
ก
F F Hub
ก F F Hub
ˈ
ก F ก
F
ก

2-11 ก

F

2.3.4.4
F ก

F
F

Network
120-156)

F ก F Hub ˈ
F F
ก ˈ UTP
(Repeater) ˆ
ก
กF

F

Hybrid ˈ ก
F
F
Bus
Ring
F กF
F F
F
Hierarchical
Tree

F

2-12 ก

F

Star
F F
Star
F ก
ก

F

Fก
ก
Fiber Optic
F Switch ˈ

Hybrid

F

F

F F F ก
F
Hybrid
(
F, 2551 :
13
2.3.4
2.3.4.1 F ก
ก
ก
ก
ก
ก
106 Hz F
F ก
F F
F
F ก
Fก ก F
F
ก
ก
F F F
ก
F ก
F
F กF
ก)
ก
F F
F ก ˂

ˆ
(Twisted Pair)
ก
F ก
F ก
1 F
F
Fก
F
˂ก
F F
F
ก
F
ก F F
F
F ก
F
ก
ก

F

2-13
)
ก
˂ ก ก

F F
ก

Fก

F
F

F
F

ก

F F ก ˈ 3
F กF
ก
F F
ก ก
˂ ก F
F
ก
˂
F
F 105 Hz
F 12 F
ก
F ก F
F F
F
F
F F
F
F
F ˈ ก
F
Fก
ก
F F
ก F F ก
ก
F
2
(Shielded Twisted Pair : STP) ˈ
F
2-13
˂ ก ก
ก

F

F F

ก
F

Fก

ก

2-14

(Unshielded Twisted Pair : UTP) ˈ
ก
2-14
F
ก ก F
F
˂ F F กF
ก

F

ก

F F

F
14
2.3.4.2
ก FF

ก

ก

ก

ก

F

F

F
75
˂ ก ก

ˈ

ก
F

F

ก

ก
F F F
F ก ˂
˂

F

F

F F
2

F
F
50

ก
F
F
ก

ก
ก
ˈ F
500 Mhz.

Fก F

ก
ก

F
F

F F F
F
F
F F

F

F

2-15 ก
2.3.4.3 F
F F

F
F

F F F
ก

F
F
2ก
F

F
F

ก

(Fiber Optic) ˈ ก F
F กF
F
F
ก ˆ
F F F
ก
10 ก
F F FDDI
F F F
100 ก
F
Fก ก
ก
F
F F F
F
ก
F ˈ ก ก F
ก
ก

2-16 ก

F
15

ก F

2-17

F F

2.3.5 Lan Protocol - Ethernet ˈ
Lan
F F ก 3
ก
ARCnet Token Ring
Ethernet
ก ก ก F
ก F F ก F Topology ก
ก F ก
2-1
2-1

F ก
ก

IEEE
ก

F

F
ARCnet
Token Ring
Ethernet

IEEE

2.5 Mbps
4
16 Mbps
10 Mbps

Coaxial , UTP
UTP , STP
Coaxial , UTP

ก F
Ethernet F
F
IEEE 802.3
F ก ก
Xerox
ก
F F
F
10 Mbps F
ˆ
F
ก F Fast Ethernet Gigabit Ethernet

Topology
Star , Bus
Ring , Star
Bus , Star
Ethernet
ʾ 1970 ˈ
16
IEEE 802.3

2-2

ETHERNET
10

10

Mbps

Mbps

ก F Fast
Ethernet system
IEEE
802.3

ก F Fast
Ethernet system
IEEE
802.3
ก F

F Fก

ˈ

10
Mbps
ก F Fast
Ethernet system
IEEE
802.3
F
(Coaxial Cable)
(Fiber Optic Cable) F

10
Mbps
ก F Fast
Ethernet system
IEEE
802.3
Ethernet
ก

ก
F (Twisted
Fก F

ก
Pair Cable - UTP)
กF
BUS ก Ring
ˈ F
F
ก
F
Ethernet ก F
F F
ก F
F
F F F
F ก F
Ethernet
ก
F F F ก
ก
F F F 10base2,
10base5, 10baseT, 10baseFL, 100baseTX, 100baseT4
100baseFX
Fก
ก
F F
ก F F
F F F F
10base2 ˈ
F
10 Mbps. F
Coaxial
กF
Thin Ethernet
ก
F (Topology) ˈ
BUS
ก
F F
185-200
ˈ F (Available online at http://school.obec.go.th/mrPaisan/elearning /information/content/internet1.htm, 2008)
17
ก

2-3

F

Ethernet

ETHERNET
ก

F
10base2

ก

F F
10 Mbps

ก

F F

185 - 200

Topology
F
BUS

F
Cable
Thin
Coaxial

ก
Thin Ethernet
Cheapernet

10base5

10 Mbps

500

BUS

Thick
Coaxial

Thick
Ethernet

10baseT

10 Mbps

1000

STAR

Twisted
Pair (UTP)

Thick
Ethernet

10baseF

10 Mbps

2000

STAR

Fiber Optic

Thick
Ethernet

100baseT

100 Mbps

1000

STAR

Twisted
Fast Ethernet
Pair (UTP)

2.4

F
F (Server)
2.4.1 Web server
ก HTTP (HyperText Transfer Protocol)
FF F
F F
ก
ก F Browser F ก http://www.thaiall.com
http://localhost
ˈ F
ก
F
ก Web Browser F
F
ˈ
ˈ F
ก
F
F
ʽ ก Web Apache Web
Server
Microsoft Web Server
18
2.4.2 DNS Server
Domain Name System Server ˈ
ก
ˈ
IP
ก
ก ก Cache
Local
ก
ก
F F ก
2.4.3 FTP (File Transfer Protocol)
ก ก - F F
ʽ FF F ˈ
ก F F F
ˈ F F F
F F
F
ก Anonymous
ˈ Fก
กF ˈ
F F
F F
F ก
FTP
F
F
ʽ ก FTP
ʽ TCP
Port 21 F ก
F
FTP 2 Mode
2.4.3.1 FTP Standard Mode ก
F Server
F ก Client F Port 20
ˈ Out Going Port F Port ˆˉ Client
F F ก ก F F Client Firewall F ก
FTP ก
F F F
2.4.3.2 FTP Passive Mode ก
F Client ˈ F
F
Server
F
Port F F ก ก F F
2.4.4 Mail Server
ก
- F
ก ก
F F F F
F Attach File
ก Address Book ˈ F
F Mail Server
ˈ
Fก
F hotmail.com
thaimail.com ˈ F
2.4.5 SMTP Server
Simple Mail Transfer Protocol Server
ก F E-Mail
ก
SMTP F
F F
F
ก Fก
IP F ก Fก F SMTP
F
F ก SMTP
ก Fก
ก
Fก
F
ก
ก SMTP กF
ก
F F Fก
Relay F
F
F "Open Relay" F
F
F F ˈ
F F
Relay F
F
ก
F F ก SMTP Server ก
F
SMTP
F F Bomb Mail
Mail Box
˂
ก
SMTP
F F
19
2.4.6 POP Server
Post Office Protocol Server
ก - F
ก Mail Server ก
ก
ก
F
F Mail F
PDA F F F
F Mail
thaimail.com
ˈ Web-Based Mail ʽ F E-Mail F ก Web F
ʽ F Outlook F F
2.4.7 Database Server
ก F
ʽ FF F F
กF
ก
ก
F
F F กF MYSQL
Microsoft Access ˈ F
F F F
ก
F
F
F
F
F ก
2.4.8 Proxy Server
F ก
F
กก
F
ก
F
F F ก
F
ก ก F
F
F
Proxy Server
F
F
Proxy Server F
F ก ก Fก
F
ก
F
ก F F
F
กก
F
Proxy Server F
ˈ ก
F
ก
ก
F
F ˈ
F Proxy Server
F ˈ Cache Server
F ก F
F F F
ก ก
F
F
F Proxy ก
ก
F
F ก
ก Cache
F F
F
F ก ก
ก Cache
F F
Proxy Server
F Linux F
Squid ก F ก Port 3128 ˈ F
Proxy server ก
F
Address
F
package F
Local Host
Address
Package F
Local Host
ก
Proxy Server ก
Caching
F Local Host F F
ก F
ก
ก
Local Network F F ก
ก
F
F ˈ
2.4.9 NAT (Network Address Translation)
ก ก IP ก
IP Sharing
F
F
F Local IP
Fake IP F Real IP F
F
ก
ก
ก
F ก
Local IP F
ก
ก F ก ก F F
ก
F ก
F Real IP ก
ก ก
ก F
F
ˈ NAT Server
F Firewall
ก ˂
ก
F
Local IP
Fก F
กก ก F
F
F IP
NAT Server
F
F F
ก F
ก ˈ
NAT Server
F ˈ F F
Cache Server ก F
ˈ Proxy Server
20
ก

F F กF
F ˈ NAT
F
ก
F ˈ NAT Server F WinGate, WinRoute, WinProxy
ICS (Internet Connection
Sharing) ˈ F
2.4.10 DHCP server
DHCP (Dynamic Host Configuration Protocol)
F ก
ก
IP Address
กF
ก F
TCP/IP
DHCP Server
F
ก IP
F F F
ˈ ก
F
ก Boot ก
IP
Address, Subnet Mark,
DNS
Default Gateway
ก
F
กก DHCP Server
2.4.10.1
ก F
DHCP Server
F
F DHCP
Discover
F
IP Address
2.4.10.2 DHCP Server
F IP F F
F
F F DHCP
Offer ก
F
ก
2.4.10.3
ก F IP ก F
ก DHCP Request F
F
2.4.10.4 DHCP server F
DHCP Ack ก
F
ก
F F
F
F (Available online at http://www.vcharkarn.com/vblog/41000,2009)

2-18 ก

F

User F

Internet

F

Lan
21
2.5 DNS (Domain Name Service)
2.5.1 DNS (Domain Name Service)
DNS ˈ
ก
F
ก F
F
F
F
F F
F F
F
F
F F www.yahoo.com ˈ F
F
F
F F
F ˈ 2 F
F
F) www
F
yahoo.com
F
F ˈ
F
F F F ก F
F ˈ F F ก
F
F (Web Server)
F F
(IP Address)
ˈ
ก DNS
ˈ
ก
F
F
F Fก
F
F

F

2-19 ก

F

F F

F

FF
F(

ก

F

F
F

F
ˈ
ก

F
ˈ
F
ก ก

Domain Name Service

F F ก
F
F
F 2
(Domain Name Registration)
F F
F F
F (Real IP Address)

F

ก
ˈ ก ก F
ก
F

ก
F

F
F
22
F
F F ก
F
F
ก
(Fix Address)
F
F
ก
F F F ก
F
F
F F F FF
F
ʾ
ˈ F
ก ก F SME
ก
F
2.5.2 Dynamic DNS
F
F ก DSL ก
ˀˉ
ˆ
ก F F
F
ก ก SME
ก
F
F
F
ก
F
F
F ก
ก
F ก ก ก
F
Fก F
F ก ก
F
F
F
F
ก
F F F
ก
F
F
F ˆ
ก
F
กก
F F F
F
F
F F
F
F F ก
ก F ก F กF F F ก F Dynamic IP Address F ก
F
ก
F
203.177.128.51 F
F ก
F
203.177.128.96
ก
ก
F
F
F F
F
F
F
F
F
F ก

2-20

F

ก

F

F

ADSL

F
F ˈ

F
SME
F F
ก
ˈ F

F
23
ˆ
ก F
กF
F F
F F
F FF
F F
ก Dynamic DNS
F ʽ F ก
ก
F
thaiddns.com dyndns.org no-ip.com กก
ก Dynamic DNS
ก
DNS
Fก F
F
ʽ F
ˈ
ก กF
ก
ก F
F F ( F homelinux.com) F ก
F ก Fก
F ˈ
ˈ ก ก F
F
F (mycom.homelinux.com)
F ก
ก
ก ก
ʽ
F F ก
F F
F
F กF
F F
F ก
F
ก
F F
F F F ก Dynamic DNS
F
F
F F
F
F
F F F
ก Dynamic DNS F
F ก
F
ก
F
F
F
ก
2.5.3
ก Dynamic DNS Client
ก
F
F ก
F
F
F
F
ก F F F F ก F
F F ก Dynamic DNS
˂ F
ก
F
ก F F
ก
F
ก
Dynamic DNS Client
ก
F F ก
ก
ก F
ˈ
F
ก F F
ก
F
F ก
F F Perl
Java
F
ก
Fก
F F F
F Dynamic DNS Client
F
ก F กF Zyxel P660R
Fก
F F F F
2-21

2-21

ก

F Dynamic DNS Client

Zyxel P660R

กF
ก
F

F
FF

F

F
24
F
F

ก

ก
ก F ก

F

F

FF
ก F ก
F

F
F

ก

F

F

ก

F

ก

ก
F

F

ก

ก

F
F กF

ก
DNS F

2-22 ก
2.5.4 F
ก

ก
F F
F

F

F

ก Dynamic DNS
F F ก Dynamic DNS F
F F
F
F
F
ˈ ˆ

F

ก Dynamic DNS Client

Dynamic DNS
F
F ก
F
F
ADSL
ก
F
Fก
F
ˈ
F
F
ก
ก
ก F ก
F
F
Fก
Upstream
F
F 128 k. F
ก ก
F F
F
ก
ˈ
F
F
F
F
ʽ
ʽ F ก กF
ก F FF
ˈ ก
ก ก
ก F
F
ก
F ˈ ก
F (Value Added) Fก
F Fก
F
F ก F F F F ก
(Available online at http://
www.itdestination.com/articles/dynamicdns,2008)
25
2.6

ก Microsoft Visual Basic
ก
ก
ก
ก
ก
F F
F
F
F ก
ˈ F ก FF
F
C C++
ˈ F
F
F
Fก
F
ก
F
กF ก
F
Command Line ก
F
ก
F
F
F ก
F ก
F F ก F F F ก กF
F
F
ก F
F
F
ก
F
ก
ก
ˈ
F
F
F F
ก
F F ก ก Visual
Basic 1.0 F F
F
ก
ก
ก
F
F ˈ
F
F ก
F F
ก F
ก
ก ˈ F
F ก F
ก F
F
F
ก
F
F
F F
ก
F
ก กก
ก
ก
F
ก
ˆ
Visual Basic F
F 6.0 F
VB ก ก
กF
F
ˆ
F
F
ʾ F F
F
ก
ก
VB
ˈ
ก
F F
F F ก
F
F ˈ
ก
F
F F
ก
F
VB F
F
DHTML
F Run Web F
ก
ก
ActiveX F ก
VB
F
Fก
F ก F
F VB
ก
F
F F ˈ F
F
F F ก
F
F
F F
ก ก
F
F F
ก
F
ก F F
VB F
F
กF
(Controls) F
ก F กF
ก
F F ก
F ก
F
F VB
ˈ F
ˆ
ก F
F
ก
F ก
ก
ก F
VB
ˈ
ก ก
F
F TextBox Label ComboBox ˈ F
ก
F
กF
ก ʽก
F
F (Graphic User Interface-GUI)
ก
F
F
F
F ก
F ก
F
F
F
ก
26
ก
ก
F

F F(
ก

VB

กF

ก
ก

FF ก
ˈ F

ˈ

F Event)
ˈ กก
ก
กF
F ก (Event-Driven Programming)
F
Dialogbox Toolbars
F ˈ
ก F F ก F (Object
VB
ˈ F ก F
ก
F
F F ก
F
ก F
F
ก ก
ˈ F Fก F
(Properties)
(Methods)
F
F ก ก F
Fก
F ก F
F
กก
F
กF
F ก

Textbox ˁ OK
Model) ก ก F
กF
ก
F F
ก
(Properties)
F
F ก
ก F ก F
F ก F
F
F
F
F
F
ก
F VB ก
F (Code) ก F ก ˈ F
ก
ก (procedure) F ก
ก
ก
F
F
F F
F ก F
ก ก
F F F
F
กF ก
ก
(Object Oriented Programming-OOP) F
VB
F ˈ OOP F
F
ก F ก
F
Visual Basic F
ก
C++ ก
ก
F ก
F
ก F ก ˈ F
FF F ก
ก F
(Debug) ก กF ก F
F F
ก F F
F
ก
F
ก
FF
ก
F
2.6.1
F (Form)
ก F
(Object) F
F
2.6.1.1 ก F F
(Text Box)
F
F
2.6.1.2 ˂
ก (Label) F
F
2.6.1.3 ˁ
(Command Button) F
F ˁ ก
2.6.1.4
F F (Combo Box) F
FF
F ก
2.6.1.5 ˁ ก (Option Button) F
ˈ
ก
ก
2.6.1.6 ก F
ก (Check Box) F
ˈ
ก
ก F
2.6.1.7 ก F
(Image)
F
ˈ F

กF
F

F
F
F

ก

F

F F
27
2.6.2

(Name),
ก ก
(Object),
ก
F
ˆ กF ก
2.6.3

2.6.4

(Object)
ก
F F F
F
ก
2.6.2.1
(Properties)
(Object)
F
ก F (Width)
F F
2.6.2.2 ก F (Event) ก F ก
กก
F F ก ก
(Object)
F
ก (Click) ก F
F
(Key Press) ก
F Fก F F
ˈ F
2.6.2.3 ˆ กF ก
(Method) ก F
F
(Object)
F (Add Item)
F F (Combo Box)
ˈ ˆ กF
F ก
F
ก (List)
F F (Combo Box) ˈ F
F
(Object)
(Method) ก F ก
ก
(Object)
ก F
ก VB
2.6.3.1
File -> New Project F
F
ก F F
2.6.3.2
File -> Open Project F
ʽ
ก F
F F
2.6.3.3
File -> Save Project F
ก
ก F
2.6.3.4
File -> Save Form F
ก F
2.6.3.5
File -> Print F
F Source Code ก
F
2.6.3.6
File -> Make Project.exe F
F
F
ก F Project

2-23

ก F F

F
28
F

F ก
Standard.exe กF
ˈ
F
F (Compile)
F
F
ก
.exe
ก
F
F F
F (Environment)
VB 6.0
F ก F Integrated Development Environment VBIDE
2.6.5 F F
VBIDE
VBIDE ก F
F F F Properties F F Project Explorer
ก ก
ˈ
F
ก VB 6.0

F

2-24
F
F

F

(Menu Bars)
ก
F
ก F ˈ
2.6.6 F F
F F
Project
ก

ˈ

F

VBIDE
F F
F

F

F
F

F
ก

ก F ก
ก

VB 6.0
ก

F

ก
F

ก
ˁ F
F
F
F
ก
F
F
ˈ ก
ก F VBIDE
F
New Project (New Project Window)
New Project
ก
F VB
ก
F F
F ก
F
ก
ก
Standard.exe
ˈ
F
F
F F กก
F F
ก .exe

F
F (Tool Bars)
ʽ
ก F,

File/New
ก
29

ก F

2-25

F New Project

2.6.7

F (Tool Bars)
F ˈ
F
ก
ก ก
F
F
F F ก
ก View/Toolbars (
F
ก
ก F
F Pop-up
ก
F ก F ก )
ˁ F
F
F F ˈ F
F
F
F F
F
ˁ
2-3
(ToolTip)
ก
ˁ
F
F ก F ˈ 4ก F
F
2.6.7.1 Standard
FF ˈ
F ก (default) F F
ก
F
กF
ก
F
ก ก ก F
F ก ʽ
ก F,
ก F ˈ F
ˈ
ก
F กF F
ก File
Project Debug Run Tool ˈ F

2-26

ก

F Standard
30
2.6.7.2 Edit
ก Cut Paste ก

F

F

F

ˈ F
F ก

ก

Fก F

Edit

ก

2-27
2.6.7.3 Debug
ˈ ก F
F
F

Code Editor

ก
F F
F

F
F ก

ก

2-28
2.6.7.4 Form Editor
F
F
F ˈ

F ก
ˈ ก
F F Immediate

F ก
F

ก

ก

F

F Run Stop Pause
F F
F

F Debug

Fก F

2-29

F Edit

F ก
Format

F

F Form Editor

F

2.6.8

F ก F (Tool Box)
F ก F ˈ
(Controls) F
ก F
F ก
ˈ
Visual Basic ก F
F F
F ก F
F
VB
ก ก ˈ ก F
F
F2ก F

F ก
F
Fก

ก F

F
31

2-30

Control

2.6.8.1
(Intrinsic controls) ˈ
ก
VB
ก F
ก
ก F
F
FF F F
F
(Remove)
ก ก VBIDE F ˈ
F
ก
ก F
ก
2.6.8.2
ActiveX (ActiveX controls) ˈ
ก
ActiveX F
F
ˈ
F F ก F
ก F F
F F *.ocx
F
F
ก
ก F F
ก F F
Fก F ก
ก Project/Components (
ก
Fก F ก
Components ก F)
2.6.9
F (Form)
F
FF ˈ F ก F ก F F
FF ก
ก ก
ˈ
F
FF ˈ
(Container)
ก
VB
F F
ก
F F Project Explorer ก F
F
F
1
ก F
ก
F F
1 F (
ก F
F
F F ก
ก .dll ˈ F
F
(In-Process)

VB
ก F
F

F
F
ก

F
Fก
F
F ก
32

2-31

F F

VBIDE

2.6.10 Project Explorer (Project Explorer Window)
F F Project Explorer F
F
ก
ก F
ก VB 6.0
ก
Project
ก F ˈ ก F
F(
ก .vbg)
VB
ก F
F
F
F
ก F ก
ก .vbp F F Project
ก
F ก
F
ก F
F F F (Tree-View)
F ˈ
F F
F ก
ก F
F ก F
F F
F ก F ก
ˈ F F 2
ก
ก ก ˈ F F ก ก
ก F F F ก F
F
ก
ก ก F
F
F F ก
F
ก F ก ˈ
F ก
ก F
2-32

2-32 Project Explorer

ก F

ก F F
Multiple
ก F
Explorer
ก F
F

F

ก F
ก F
33
2.6.11
ก
F F
(Initial)
programming

F

F
F

F F
(Properties Window)
F F
Fก
(Active)
F
(Focus)
F ก F ก F
F ก F
F ก F F
F VB F F
F ˈ F
ก F FF
ˈ F ก F
F
F F
F
F F F ก
F
ก F
F ก
F F
F F

2-33

F
F
F

F
FF ˈ
VB
Fก

VB

F F
F F

F F

F F Form Layout
F F Form Layout F
ก
ก
F
F
ก
F ก drag F
F F ก ( F
F
F
F
F
F F
F
F

F ก F
VB
F
F F
ก

F
ก

F ก (Default)
F
F
F
F F
ˈ

Alphabetic

2.6.12

F

F
F

F

ˈ

ก

F

F

F
ก 4 )
F ก F

F

ก
F F
34

2-34
2.6.13

F F
ˈ

ก

F F
ก

ก

F
F

F F

ก

F F Form Layout

(Immediate Window)
F ก
F ก
ก
ˈ F
F F
ก
ก
View/Immediate Window F ก

2-35
2.6.14

F

F F Immediate

VBIDE
F

2.6.14.1
ˈ

F

VBIDE
F F2
MDI (Multiple Document Interface)
F ก
VB
2-36

F F

ˈ
35

2- 36

F

VBIDE

MDI

2.6.14.2
SDI (Single Document Interface)
F F
ก
ˈ
F ก F
Fก
MDI F F
ก
2-37 (Available online at http://kampol.htc.ac.th/web1/ subject/programming2/
sheet/vb6/vbch01.htm,2008)

2- 37
2.7

ก
ก

F
ก
ก

F

VBIDE

SDI

F
(2548 : ) F ก ก
ˈ ก F
F กก F
ʽ
F
F F F
F ก
F

ก
ก
ˈ
F ก F

Fก F
F

F
ก

กF
ก

F
F
36

F

F
ก
F ก
F ก F
ก F
ก
ˆˉ F
ก F
F
ก F

F
F F F
Web Server
ก F
ก
ก F
Fก F
F
ˈ ก
ก ก ก F
F (2548 : ) F ก ก
ก F
F
F
กก ก
F
F ก F F
F F
F
ʽˊ
F F
ก
ก F
Fก
Fก
F
ก ก
ก F
F
F
F F
F F
ก (2551 : ) F ก ก
ก
กก ก
F
F
F
F
ก ก
ก F
F
F
F
F F
F F
ก
F
F F
F
ก
ก F
F
F
F
˂ F
ʾ
F
F
F
F
ก F F
ก
ก
IP Address
F
F
LAN F F
F
กก F
Fก F
3
ก
ก

ก
F

3.1 ก
3.2 ก
3.2.1
3.2.2
3.2.3
3.3 ก
3.4 ก
3.5
3.1 ก

ก
ก
F

ก

ก

WebCam ˈ ก F

ʽ F

F

ก ˈ 5

F
F

ก
(Flow Chart)
Context Diagram
Data Flow Diagram
ก ก
ก F
F
ก
ก F
F

F

ก ก
F ก
WebCam
F
ก ก
ก ˈ 2 F
ก
ʽ
ก ก F
F
(Admin)
F
F ก
3.1.1
ก ก
ก
Webcam
F
ก ก
F
F ก F
F ก
ก F
ʽ
F ก
F
F
Fก F
F
F F ก ก
WebCam ˈ ก F
ʽ F
F
3.1.1.1
ก
(Dynamic DNS) ˈ
F F
F
F

ˈ ก F
ก
(User)
ˈ ก F
ก ก ก
2
ก

ʽ F
F ก F
ʽ F
F
F

F

ก
38
ก

Fก

F

F

F F ก

ก
F กF F ก
ก F
203.156.24.52

ก

F
F
3.1.1.2 DNS ( Domain Name Service ) F
F www.company.com
F
กF
F
F (DNS Server)
3.1.2 ก ก F
F
(Admin)
F
F
F
(Admin)
F
F กF
ก
ก
ก
กก F
F
F F ก (User) F F
F
F
F
F
กF F
F
F
3.2 ก
3.2.1

ก
(Flow Chart)
3.2.1.1
(Flow Chart) F
ก
F
ก F
ˈ F
ก
F
ก
ก
กF
F
ก F
F
F F
F กF
ʽ
Real Time ก
On Demand

F

F ก

ก (User)
F
ก F
F
ก
ก F
ก F
Real time

F

F F
F
F

F
Sever
Fก ก
ก

ก

ก
ก
กก F
39

F

ˆ
(Real Time)

ก

F

F
(On Demand)

ก

ก

ก

3-1
3.2.1.2
Password
ก
F

Flow Chart

(Flow Chart) F F
F F
ก
F
F F ก F
ก
ก F ก
ก

ก

F
F F F

F
F
ก F F

ก

กก F

ʽ

ˆ

F Username
F ก
F
ก
40
F

Username
Password
Fก F

ก F

กก F
(Real time)

F
(On Demand)

F F
ก ˁ Stop

ก

3-2 ก

F

F

F F
41
3.2.2 Context Diagram

3-3 Context Diagram

F F

ˈ ก
F
FF F ก F ก
F 3.1

ก
F2 F

F User ก Admin

Fก F
session

ก

F

6
ก ก

Admin

User

session
F

ก F

F

F

F

Username Password F

F

ˆ

F

F

F
ˆ

3

2

F

F

ก

F

F

ก F

F

Username Password
F F

3-4 Data Flow Diagram

F

F

1
F F

F

ˆ

F

F

ก ก

User

Admin

ก

F

กF

กF

F

F
F ก

กF

F

F

F

4
ก

5
กF
ก

F

ก

F

42
43
3.2.3 Data Flow Diagram
ก
ก F Process F
Process 1 ก F F
F F
Admin
F F
ก)
F F F
)
ก

F

ก

ก ก Username

Password

F

ˆ
F

F

F

3-5 Data Flow Diagram Level 1 Process 1(ก
Process 2 ก
F
ˆ
F Admin

3-4

F

ก
F

3-6 Data Flow Diagram Level 1 Process 2 (ก

F F

F F

)

F

F

F

F

ˆ

)

ก
44
Process 3 ก
F

F

F

ก
ก) ก
) F

F

User ก Admin
F
User F ก
F

F
F

Process 4 ก กF /
Admin
ก) ก F
)
F
F

F
ก

Admin
F F
F

F

F ก

กF

ˈ ˁ

ก ก

F

ก
ก

)

กF

4.
F

F

F
F

ˁ

F ก

Admin

F

ก

F

ˈ

F

4.1
ก

F
F

ก

F

3-7 Data Flow Diagram Level 1 Process 3 (ก

F

ก

ก

F

3-8 Data Flow Diagram Level 1 Process 4 (ก

F

F ก
ก

กF /

กF

F

ก ก

F

)
45
Process 5 ก
ก F
ก F
ก) ก ก
) ก
F

ก

F ก

ก F

Admin

ก

3-9 Data Flow Diagram Level 1 Process 5 (ก
3.3 ก

ก ก
ก ก F

ก F

ก

F)

ก F
ก F

ก

User F

F (Attribute)

3-1

ก

ʽ F
1
2
3
4
5

ˈ ˁ

ID
Name
Surename
Usermame
Password

text
varchar
varchar
varchar
varchar

10
20
10
50
50

ก
ก
ก
F
F

F

ก

F
PK

ก
46
3.4

ก
3.4.1

F
F

ก
ก

F
ก

3-10
3.4.2

F

ก

F

ก

ก

ก User

3-11

F

ก User
47
3.4.3

F Login F F

ก F

3-12
3.4.4

F

F Login F F

ˆ

3-13

F

ˆ

(Real time)
48
3.4.5

F

FF

3-14

3-15

F

FF

F

FF

ก ก
49
3.5 ก
ก
3.5.1 ก
3.5.1.1 ก

ก Fก F WebCam ก
ก
ก Fก F WebCam
ก
F
ก
ก

3-16 ก
3.5.1.2 ก

ก

3-17 ก

F
F

ก
ก User F

ก

F

ก

F

F

ก Visual Basic

ก
ก Visual Basic

ก User
50
3.5.1.3 ก

F Login F

ก Macromedia Dreamweaver

3-18 ก
3.5.1.4 ก

F

3-19 ก

FF

F
F

Login

F

ก Macromedia Dreamweaver

FF
51
3.5.1.4 ก

F

F ˆ

3-20 ก
F

F

ก Macromedia Dreamweaver

F

F ˆ

ก Visual Basic

ก F
ก F
ก ก
ก
F กF ก ก
3.5.2.1 ก
ก
ก
F
3.5.2.2 ก ˁ Start Broadcast
F
Internet F
3.5.2.3 ก ˁ Start Record
F
F
Internet F
3.5.2.4 ก
F
F
ก ก
WebCam A
port : 1252 WebCam B
3.5.2.5
F Device
กก F
ก Capture Audio
ก
ก
F
3.5.2.6
F Video Limit
ก
F
F ก 60
20100310-093026
F
F กก
F ก

ก

ก .

3.5.2

Fก F WebCam

ก

ʽ F

กก F WebCam
ก F ก F

ก

ˈ ก F

ก

ก F

ก

ก F

F F
F
FF

F

F
port : 1251

2ก F

F

ก F
F F F 60
ˈ 20100310-103026 ˈ F
F FF

F
F F
52

F

3-21
3.5.2.7
ก Folder F ก
กก ˈ
F

ก ก
F
ก
ก
ก .wmv

ก

F
F

3-22 ก ก

ก

(Server)

ก ˁ Browse F Video Path :
ก c:AppservwwwWebCamvideo

Folder

ก

F
F
53

F

3-23

ก

F

F

3.5.2.8 ก
ก กF
ก
F User
ก)
FF
User
F Fก ˁ
ก
) F
ก กF F
ก Fก ก F
Fก ˁ
ก
) F
ก
F
ก ก F ก
ก
F
ก ก

3-24

F

ก User

ก F
F
ก

F

Use
F
F ก ˁ
54
3.5.2.9
ก)

ก F F
F
ก ก Username/Password
F

F ก ˁ Login

ก

F

F

F

3-25
)
F ก

ก

F F F
F

F
Fก

3-26

F

ˁ

F
ก

F

F

FF

ˆ

(Real Time)

ˆ

ก
55
)
ʾ
ก F A ʾ 2010

F

F F

06

06

F

F VDO

F

ก

F F ก

F

F F ก
ก F
B F A-20100606-143050.wmv

F

F

F F Fก ˁ
F
ก Windows media player

ʽ

3-28

F

F2ก F A
14:30:50 .

3-27
)
ˈ .wmv

F

F

ก

F

F

ก
56

3-29

F

ก

F
4
ก
ก

ก Fก F WebCam ˈ ก F
ʽ F
F
2
ก
ก (Server)
F
F (Client)
F Server F
CPU Pentium 4 3.0 Ghz. Ram 2 GB. F
F Client F
CPU Pentium 4 2.8 Ghz. Ram 1 GB.
F
F 4 MB.
F
F ก
F
4.1 ก
ˁ ก F
4.2
F
ก
4.1 ก
4.1.1 F
F ก

ˁ

ก

ก F
Device

กก F

4-1

F

Device

F

F

ก

ก F USB
58
4.1.1.2 F
4.1.1.3
ก
ก
F
F F F ก 10
ก
ก F
F F ก
F
F ก 60 MB.

Video Path ก Folder F ก
ก
F
F
Video Limit
F
( )
F ก
F
ก
F
ก
ก
ก
F
F ˈ
F F ก 10
F
Fก
F Fก
F
60
F F 60
F 1
F 1 MB.

4-2

Video Path

Video Limit

F

F
59

F ก

4.1.1.4 F
ก User
F
กF
ก
F F F
ก
ก F
F

4-3

F

ก ˁ User Account
ก F ก F
F
F User
F F Fก F
F กF

F

F

ก User

4.1.2 ˆˉ Client
4.1.2.1
F F
F
F F
F
F URL
ˆˉ Server
http://192.168.0.224/webcam/login

4-4

F

Login F F

F F http://192.168.0.224/webcam/login
60
4.1.2.2
/Password
F

ก

F F Login
F ก
F
F

F

F

4-5
4.1.2.3

F

F

ก

F

F F

F F Username

F F

Username (ee) F

ee

F

4-6

F

ก

F

F

F

F

F
61

F

4.1.2.4
F

F

4-7

4-8

F

F Username / Password
Fก F

F

F

ก

ก

F

F

F

F

F

Fก F

F

ˆˉ Client

ก
62
4.2

F

4.2.1
5 F ก

ก

F

ก F กก F
F 10x10

4-9
4.2.2
F
F 1ก F
ก

Webcam

ก

F ก
F
F
15:49 .
F
ก
F
F F

4-10

F

F

ก กก F Webcam
ก

4-10
F
F
ก
16:49 . ก
1 .
Video Limit ˈ 60
ก F
กF ʽ

F

ก

F

58.3 MB
60
ก
63

4-11
4.2.3
F

ก
ˈ ก
3 F ก ก B
Fก F ก F A
FF
ก
ก Fก

F

F ก F A (3 F
F
5 F

ก

ก ˈ

) ก B (5 F

ก

1
F

.
F

ก F

F

F

ก

)

F ก F A
ก F B
F
F
64

4-12
4.2.3 ก

F

ก
F ก
ก ก
1-2

F

F

4-1
F กก F A

F

3x7
ก F ก

กก F

2ก F

4-2 ก
F ก F
A
B
4-1
F
ก
1234
9x20 .
ก
F Windows Server 2003 R2 F
F ก
F
F F
ก กF
F3
F
F
ก
4-2 ก
F ก F B ก
1234
9x20 .
ก
F Windows Server 2003 R2
F
ก F
ก F
ก ก F ก F A 1-5
FF ก F
ก ก
ก Fก F
F
F
Fก F
ก
ก ก F
F
F
F ก
3x7
65
4-1

F

ก

ก
F

F ก F A (3 F
F

กF ก

ก
(

1234
9x20 .

1

1234
9x20 .

2

1234
9x20 .

3

1234
9x20 .

4

1234
9x20 .

5

)

ก
ก

)

F
66
4-1 ( F )
F
F

กF ก

18x23

.

18x23

.

18x23

.

18x23

.

18x23

.

ก
(

1

2

3

4

5

)

ก
67
4-2

F

ก

ก

F

F ก F B (5 F
F
กF ก

ก
(

1234
9x20 .

1

1234
9x20 .

2

1234
9x20 .

3

1234
9x20 .

4

1234
9x20 .

5

)

ก

ก

)

F
68
4-2 ( F )
F
F

กF ก

18x23

.

18x23

.

18x23

.

18x23

.

18x23

.

ก
(

1

2

3

4

5

)

ก
5
ก
กก
F
F
F
ก

F

F

5.1

F

ก Fก F Webcam ˈ ก F
ʽ F
Fก F
ʽ
ก
ก
ก
ก
ก F ก ก F Webcam F
Username Password ก F F
F กF

F

F ก
Fก ก F
ก ก F

ก
5.1.1

ก Fก F Webcam

F

F ก

ˈ ก F

ʽ

F

F
5.1.2
5.1.3
5.2 F
5.2.1 F F ก
ก
5.2.2 ก
60 MB.
5.2.3 ก
F
F
F

ก
ก

ก
F
F
ก ก F Webcam F ก F
F

F ก

ก

Fก F

F
F
ก

ก

F
Fก
F
Web Browser
Web Browser
F

ก

ก
F

F

ก
F 1ก F

1

F

ก F
F F

Internet Explorer 8

F
70
ก
ก

F

ก F
ก

กF

F F

F
.
F

.

ก

F
ก

ก

F
F

.

ก
ก F
ก F
, 2548.
F. Advance Visual Basic
ก F F F. ก
, 2551.
F
F ก ก
.ก
:
ก (
), 2551.

ก
:

F
ก

F
F . Available online at http://school.obec.go.th/mrPaisan/e-learning
/information/content/internet1.htm[2008,June 8].
Fก ก
ก Visual Basic. Avaliable online at http://kampol.htc.ac.th/web1/
subject/programming2/sheet/vb6/vbch01.htm[2008,May 15].
F
ʽ (CCTV). Available online at http://www.matcom.co.th/
contents.php?id=300.htm, [2008,May 29].
F
F (Server). Available online at http://www.vcharkarn.com/vblog/41000
[2009,March 9].
(Web camera). Available online at http://www.tteen.net/view.php[2008,June 8].
DNS (Domain Name Service). Available online at http://www.itdestination.com/articles
/dynamicdns[2008, June 20].
ก
กก
ก

ก Appserv
73

1.

ก Appserv
74

Enter root password : 1234 (

(

Server Name

F ก )

F ก )
75
76
(
2. Copy

3.

4. F

ก
F

F

F

F WWW.

F Vedio

ก

ก Appserv )
F C:/Appserv

c:Appservwwwwebcam

F Camserver.exe

F

ก
77

5.

F

ก

ก

(Server)
78

F

ก
ก Cam Server
79

F

ก

ก

'Object
'1 VideoCapX1 ˈ Object
ก

(

ก

)

F F

ก

ก

F

F Device ก F

F F Version 6.2.0.258

'2 Winsock1 ˈ Object
F

ก

F

F

F

ก

IP

Dim cFileVideo As
Dim cPort1, cPort2 As String
Dim No1, No2 As Integer
Dim ClickBc1, ClickBc2 As Boolean
Dim fs As Object
'

Private Sub Form_Load()
cPort1 = "1251"

String '
ก
F Video
'
ก Port ก F
'
ก
ก
'
ก ก ˁ Broadcast
Object
F ก Object ก
F ก Text

' ก
'ก

F
Port

F

F
80
cPort2 = "1252"
Me.Caption = "Cam Server IP " & Winsock1.LocalIP
'
Title F
IP
Frame1.Caption = "WebCam A : " & cPort1
Frame2.Caption = "WebCam B : " & cPort2
' Device Webcam F ˈ
ก Com
For f = 0 To VideoCapX1.GetVideoDeviceCount - 1
bobox
Combo1.AddItem VideoCapX1.GetVideoDeviceName(f)
Combo2.AddItem VideoCapX1.GetVideoDeviceName(f)
Next f
If Combo1.ListCount > 0 Then
Combo1.ListIndex = 0
'ก
F ก Combobox
ก
Call Combo1_Click
' ก
ก F
ก F Com
bo1_Click
End If
If Combo2.ListCount > 1 Then
Combo2.ListIndex = 1
'ก
F ก Combobox
ก
' ก
ก F
ก F Com
Call Combo2_Click
bo1_Click
Else
LockScreen2 (False)
End If
No1 = 0: No2 = 0
' F No1,No2 F
F ˈ 0
On Error GoTo OpErr
' ก Error
F Error ก
F
OpErr F F
F
Error
Set fs = CreateObject("Scripting.FileSystemObject")
' ก F Object ก
F
F
Set fTxt = fs.OpenTextFile(App.Path & "VideoPath.cfg", 1, 0) ' ʽ F F
F
DefaultPath.cfg
txtPath.Text = fTxt.ReadLine()
'F
fTxt.Close
' ʽ
F
OpErr:
81
Set fWr = fs.CreateTextFile(App.Path & "VideoPath.cfg", True) ' ʽ
fWr.WriteLine ("c:")
'
fWr.Close
ʽ
F
End Sub
F

ก
"c:"

Private Sub Form_Unload(Cancel As Integer)
' ก
Set fWr = fs.CreateTextFile(App.Path & "VideoPath.cfg", True) ' ʽ F ก
fWr.WriteLine (txtPath.Text)
'
F
txtPath.Text
fWr.Close ' ʽ
F
End Sub

F ก ʽ

' ก F
ก Device Combobox
Private Sub Combo1_Click()
If VideoCapX1.Connected Then VideoCapX1.Connected = False ' F ก
F ก Webcam F
Fก F ก ก
VideoCapX1.CaptureAudio = Check1.Value
'
ก
ก
ก

VideoCapX1.VideoDeviceIndex = Combo1.ListIndex
index item Combobox
ก
VideoCapX1.UseVideoFilter = vcxBoth
VideoCapX1.PreviewAudio = True
VideoCapX1.Connected = True
VideoCapX1.SetVideoFormat 320, 240
'VideoCapX1.SetVideoFormat 640, 480
'7200 x 9600
VideoCapX1.Preview = True

'ก
' ก
'
' ก
'ก
'ก
'

Deivce

Webcam
ˈ Video

F
F ก Webcam
กF x
กF x
F
82
VideoCapX1.SetTextOverlay 0, "TIME", 0, 0, "Arial", 18, 255, -1 '
F
End Sub

Private Sub cmdBroadcast1_Click()
' ก F ก ˁ Start Broadcast
If LCase(cmdBroadcast1.Caption) = "start broadcast" Then
'
Start..
ClickBc1 = True
' F
ClickBc ˈ true ( )
VideoCapX1.WMAttributes = "My webcam A|Author is me|Copyright to me|rating is 5|this is
description"
VideoCapX1.StartBroadcast cPort1, 5
cmdBroadcast1.Caption = "Stop Broadcast"
'
Caption
ˁ ˈ Stop..
' ก
ก F
Object
Call LockScreen1(False)
F
F F
cmdBroadcast1.Enabled = True
' ʽ F
F
ˁ Stop Broadcast
No1 = 1
Else
' F
ClickBc ˈ false ( )
ClickBc1 = False
VideoCapX1.StopBroadcast
cmdBroadcast1.Caption = "Start Broadcast"
'
Caption
ˁ ˈ Start..
Call LockScreen1(True)
' ก
ก F
Object
F
F
F
No1 = 0
End If
End Sub

Private Sub cmdRecord1_Click()
If LCase(cmdRecord1.Caption) = "start record" Then
VideoCapX1.CaptureRate = Val(txtVideoLimit.Text)

'
'

ก

F ก ˁ Start Record
ก

ก
83
VideoCapX1.StartCapture
cmdRecord1.Caption = "Stop Record"
Call LockScreen1(False)
F
F F
cmdRecord1.Enabled = True
No1 = 1
Else
VideoCapX1.StopCapture
cmdRecord1.Caption = "Start Record"
Call LockScreen1(True)
F
F
F
No1 = 0
End If
End Sub

Private Sub cmdZZ1_Click(Index As Integer)
If Index = 0 Then
If cmdZZ1(0).Caption = "zZ" Then
VideoCapX1.Left = 15
VideoCapX1.Height = 7200
VideoCapX1.Width = 9600
VideoCapX1.SetVideoFormat 640, 480
cmdZZ1(0).Caption = "Zz"
Else
VideoCapX1.Left = 15
VideoCapX1.Height = 3600
VideoCapX1.Width = 4800
VideoCapX1.SetVideoFormat 320, 240
cmdZZ1(0).Caption = "zZ"

' F
ก
'
Caption
' ก
ก F
' ʽ

F

ˁ

F

ˈ Stop..
Object

'
Caption
' ก
ก F

ˁ

ˁ Stop Record

ˈ Start..
Object

'ก

กF x

'ก

กF x
84
End If
cmdZZ2(0).Visible = cmdZZ1(0).Caption = "zZ"
VideoCapX2.Visible = cmdZZ2(0).Visible
Frame1.Visible = cmdZZ2(0).Visible
Frame2.Visible = cmdZZ2(0).Visible
txtPath.Visible = cmdZZ2(0).Visible
cmdSelectPath.Visible = cmdZZ2(0).Visible
txtVideoLimit.Visible = cmdZZ2(0).Visible
cmdUserAcount.Visible = cmdZZ2(0).Visible
cmdZZ1(1).Visible = cmdZZ2(0).Visible
cmdZZ2(1).Visible = cmdZZ2(0).Visible
cmdZZ1(0).Top = VideoCapX1.Height - cmdZZ1(0).Height
cmdZZ1(0).Left = (VideoCapX1.Left + VideoCapX1.Width) - cmdZZ1(0).Width
End If
If Index = 1 Then
If cmdZZ1(1).Caption = "oo" Then
'ก
กF x
VideoCapX1.SetVideoFormat 640, 480
cmdZZ1(1).Caption = ".."
cmdZZ1(0).Enabled = False
Else
VideoCapX1.SetVideoFormat 320, 240
'ก
กF x
cmdZZ1(1).Caption = "oo"
cmdZZ1(0).Enabled = True
End If
End If
End Sub

Private Sub Combo2_Click()

'

ก

F

ก Device

Combobox
85
If VideoCapX2.Connected Then VideoCapX2.Connected = False ' F ก
Fก F ก ก
VideoCapX2.CaptureAudio = Check2.Value
'
ก
Deivce
VideoCapX2.VideoDeviceIndex = Combo2.ListIndex 'ก
index item Combobox
ก
VideoCapX2.UseVideoFilter = vcxBoth
' ก
'
F
VideoCapX2.PreviewAudio = True
VideoCapX2.Connected = True
' ก
Fก
VideoCapX2.SetVideoFormat 320, 240
'ก
'VideoCapX2.SetVideoFormat 640, 480
'ก
'7200 x 9600
VideoCapX2.Preview = True
'
VideoCapX2.SetTextOverlay 0, "TIME", 0, 0, "Arial", 18, 255, -1 '
F
End Sub

F ก Webcam F
ก

ก
Webcam

ˈ Video
Webcam
กF x
กF x
F

Private Sub cmdBroadcast2_Click()
' ก F ก ˁ Start Broadcast
If LCase(cmdBroadcast2.Caption) = "start broadcast" Then '
Start..
' F
ClickBc ˈ true ( )
ClickBc2 = True
VideoCapX2.WMAttributes = "My webcam B|Author is me|Copyright to me|rating is 5|this is
description"
VideoCapX2.StartBroadcast cPort2, 5
cmdBroadcast2.Caption = "Stop Broadcast"
'
Caption
ˁ ˈ Stop..
Call LockScreen2(False)
' ก
ก F
Object
F
F F
cmdBroadcast2.Enabled = True
' ʽ F
F
ˁ Stop Broadcast
No2 = 1
Else
' F
ClickBc ˈ false ( )
ClickBc2 = False
86
VideoCapX2.StopBroadcast
cmdBroadcast2.Caption = "Start Broadcast"
Call LockScreen2(True)
F
F
F
No2 = 0
End If
End Sub

Private Sub cmdRecord2_Click()
If LCase(cmdRecord2.Caption) = "start record" Then
VideoCapX2.CaptureRate = Val(txtVideoLimit.Text)
VideoCapX2.StartCapture
cmdRecord2.Caption = "Stop Record"
Call LockScreen2(False)
F
F F
cmdRecord2.Enabled = True
No2 = 1
Else
VideoCapX2.StopCapture
cmdRecord2.Caption = "Start Record"
Call LockScreen2(True)
F
F
F
No1 = 0
End If
End Sub

Private Sub cmdZZ2_Click(Index As Integer)
If Index = 0 Then

'
Caption
' ก
ก F

'

ก

ˁ

ˈ Start..
Object

F ก ˁ Start Record

'
ก
ก
' F
ก
'
Caption
ˁ
' ก
ก F
' ʽ

F

F

'
Caption
' ก
ก F

ˈ Stop..
Object

ˁ

ˁ Stop Record

ˈ Start..
Object
87
If cmdZZ2(0).Caption = "zZ" Then
VideoCapX2.Left = 15
VideoCapX2.Height = 7200
VideoCapX2.Width = 9600
VideoCapX2.SetVideoFormat 640, 480
'ก
กF x
cmdZZ2(0).Caption = "Zz"
Else
VideoCapX2.Left = 4830
VideoCapX2.Height = 3600
VideoCapX2.Width = 4800
VideoCapX2.SetVideoFormat 320, 240
'ก
กF x
cmdZZ2(0).Caption = "zZ"
End If
cmdZZ1(0).Visible = cmdZZ2(0).Caption = "zZ"
VideoCapX1.Visible = cmdZZ1(0).Visible
Frame1.Visible = cmdZZ1(0).Visible
Frame2.Visible = cmdZZ1(0).Visible
txtPath.Visible = cmdZZ1(0).Visible
cmdSelectPath.Visible = cmdZZ1(0).Visible
txtVideoLimit.Visible = cmdZZ1(0).Visible
cmdUserAcount.Visible = cmdZZ1(0).Visible
cmdZZ1(1).Visible = cmdZZ1(0).Visible
cmdZZ2(1).Visible = cmdZZ1(0).Visible
cmdZZ2(0).Top = VideoCapX2.Height - cmdZZ2(0).Height
cmdZZ2(0).Left = (VideoCapX2.Left + VideoCapX2.Width) - cmdZZ2(0).Width
End If
If Index = 1 Then
If cmdZZ2(1).Caption = "oo" Then
'ก
กF x
VideoCapX2.SetVideoFormat 640, 480
cmdZZ2(1).Caption = ".."
88
cmdZZ2(0).Enabled = False
Else
VideoCapX2.SetVideoFormat 320, 240
cmdZZ2(1).Caption = "oo"
cmdZZ2(0).Enabled = True
End If
End If
End Sub

Private Sub cmdUserAcount_Click()
Form3.Show 1
End Sub

'ก

กF x

' ˁ User Account

Private Sub cmdSelectPath_Click()
' ˁ ...
ก Floder ก
SystemPath = txtPath.Text
'ก F
F TextBox
F
Form2.Show 1
' ʽ
F
ก Floder
txtPath.Text = SystemPath
' F F
F TextBox
No1 = 0: No2 = 0
End Sub
Private Sub Timer1_Timer()
' ก F
ก
cFileVideo = Format(Now, "yyyyMMdd-hhmmss") & ".wmv" ' ก
F ก
F ˈ .wmv (
windows media player)
If No1 = 0 Or (No1 >= Val(txtVideoLimit.Text) * 60) Then '
cFileVideoA = "A-" & cFileVideo
VideoCapX1.CapFilename = txtPath.Text & cFileVideoA 'ก
F ก F Folder
F
89
txtVideoFile1.Text = cFileVideoA
If (No1 >= Val(txtVideoLimit.Text) * 60) Then
'
No1 = 1
'
'
If ClickBc1 Then
VideoCapX1.StopBroadcast
'
VideoCapX1.StartBroadcast cPort1, 5
'
End If
End If
End If
If No2 = 0 Or (No2 >= Val(txtVideoLimit.Text) * 60) Then
cFileVideoB = "B-" & cFileVideo
VideoCapX2.CapFilename = txtPath.Text & cFileVideoB
F
txtVideoFile2.Text = cFileVideoB
If (No2 >= Val(txtVideoLimit.Text) * 60) Then
'
No2 = 1 ' F 1 F
If ClickBc2 Then
'
VideoCapX2.StopBroadcast
'
VideoCapX2.StartBroadcast cPort2, 5
'
End If
End If
End If
No1 = No1 + 1
'
No2 = No2 + 1
End Sub

Private Sub txtVideoLimit_KeyPress(KeyAscii As Integer) '
' F F
ˁ Backspace
If KeyAscii = 8 Then Exit Sub
'

'

F
F

F
ก

F 1

F

F

ก

ก ˁ Broadcast
F ก Broadcast
Broadcast

'
'ก

F

'

ก

F

F
F

Folder

F
ก

F

ก

ก ˁ Broadcast
F ก Broadcast
Broadcast

+1

ก

F

ก

F

F ˁ Backspace

TextBox
90
If KeyAscii < 48 Then KeyAscii = 0
If KeyAscii > 57 Then KeyAscii = 0
End Sub

'
'

F ˁ
F ˁ

F กF 0
F กF 9

Private Sub LockScreen1(sw As Boolean)
sw (true,false) ( , )
Combo1.Enabled = sw
Check1.Enabled = sw
txtREC1.Visible = Not sw
txtVideoFile1.Visible = Not sw
cmdBroadcast1.Enabled = sw
cmdRecord1.Enabled = sw
cmdZZ1(0).Enabled = sw
cmdZZ1(1).Enabled = sw
Call LockScreenFile
End Sub

'

ก

F

Object

F F F

Private Sub LockScreen2(sw As Boolean)
sw (true,false) ( , )
Combo2.Enabled = sw
Check2.Enabled = sw
txtREC2.Visible = Not sw
txtVideoFile2.Visible = Not sw
cmdBroadcast2.Enabled = sw
cmdRecord2.Enabled = sw
cmdZZ2(0).Enabled = sw
cmdZZ2(1).Enabled = sw
Call LockScreenFile

'

ก

F

Object

F F F
91
End Sub

Private Sub LockScreenFile()
'
txtPath.Enabled = Check1.Enabled And Check2.Enabled
cmdSelectPath.Enabled = txtPath.Enabled
txtVideoLimit.Enabled = txtPath.Enabled
End Sub

F

ก

F

F

ก

ก

F

Private Sub Command1_Click()
SystemPath = Replace(Dir1.List(Dir1.ListIndex) & "", "", "")
Unload Me
End Sub
Private Sub Dir1_Change()

F

F

F

F
92
End Sub

Private Sub Form_Load()
On Error GoTo Err
Dir1.Path = SystemPath
Exit Sub
Err:
Dir1.Path = "C:"
End Sub

F

ก User

Public nConnect As ADODB.Connection
Dim NewMode As Boolean
'
Private Sub Form_Load()
NewMode = True
DataPath = App.Path & "DataBase.mdb"
On Error GoTo ChkErr
Set fs = CreateObject("Scripting.FileSystemObject")
F

F / กF

' ก F Object ก

CardAssign

F

F
93
Set fTxt = fs.OpenTextFile(App.Path & "DBPath.cfg", 1, 0)
' ʽ
F
DefaultPath.cfg
DataPath = fTxt.ReadLine() '
F
ʽ
F
fTxt.Close
ChkErr:
If Err.Number = -2147467259 Or Err.Number = 53 Then
CommonDialog1.CancelError = True
CommonDialog1.Filter = "Microsoft Office Access (*.mdb)|*.mdb"
CommonDialog1.Flags = OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST
CommonDialog1.ShowOpen
If CommonDialog1.FileName = "" Then Exit Sub
DataPath = CommonDialog1.FileName
End If
' F
F
Set nConnect = New ADODB.Connection
strConn = "Provider = Microsoft.Jet.OleDb.4.0;Data Source =" & DataPath
nConnect.ConnectionString = strConn
nConnect.Open
Set fWr = fs.CreateTextFile(App.Path & "DBPath.cfg", True) ' ʽ
F ก
'
fWr.WriteLine (DataPath)
fWr.Close ' ʽ
F
Call ShowDataList
'
F
End Sub

F

Private Sub ShowDataList()
'
F
Call HeadGridList
' F
F
Set recData = New ADODB.Recordset
cSQL = "SELECT ID,FName,LName,Login,Password FROM [Register] Order By ID"
recData.Open cSQL, nConnect, 3, 1

F

"c:"
F

F
F
94
If recData.RecordCount > 0 Then
Do While Not recData.EOF
mfGrid1.AddItem recData("ID") & "" & vbTab & _
recData("FName") & "" & vbTab & _
recData("LName") & vbTab & _
recData("Login") & vbTab & _
recData("Password")
recData.MoveNext
Loop
End If
End Sub

Private Sub HeadGridList()
mfGrid1.Cols = 5: mfGrid1.Rows = 1
mfGrid1.ColWidth(0) = 1000: mfGrid1.ColAlignment(0) = 5
mfGrid1.ColWidth(1) = 2000
mfGrid1.ColWidth(2) = 2000
mfGrid1.ColWidth(3) = 2000
mfGrid1.ColWidth(4) = 0
mfGrid1.Row = 0
mfGrid1.Col = 0: mfGrid1.Text =
" "
mfGrid1.Col = 1: mfGrid1.Text =
" "
mfGrid1.Col = 2: mfGrid1.Text =
"
ก"
mfGrid1.Col = 3: mfGrid1.Text =
" F F
mfGrid1.Col = 4: mfGrid1.Text =
"
F "
End Sub

Private Sub mfGrid1_Click()

"
95
If mfGrid1.Row > 0 Then
NewMode = False
mfGrid1.Col = 0: Text0.Text = mfGrid1.Text
mfGrid1.Col = 1: Text1.Text = mfGrid1.Text
mfGrid1.Col = 2: Text2.Text = mfGrid1.Text
mfGrid1.Col = 3: Text3.Text = mfGrid1.Text
mfGrid1.Col = 4: Text4.Text = mfGrid1.Text
cmdTool1(1).Enabled = True
End If
End Sub

Private Sub cmdTool1_Click(Index As Integer)
cCardTagID = Trim(Text1.Text)
Select Case Index
Case 0
If Trim(Text1.Text) = "" Then
Text1.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
Text3.SetFocus
Exit Sub
End If
If Trim(Text4.Text) = "" Then
Text4.SetFocus
Exit Sub
End If
If NewMode Then
cID = "01"

' ˁ

ก/

'ก ˁ

'

F

F

ก

F

F Esle กF

F
96
Set recData = New ADODB.Recordset
cSQL = "SELECT MAX(ID) As mID FROM [Register]"
recData.Open cSQL, nConnect, 3, 1
If recData.RecordCount > 0 Then
cID = Format(Val(recData("mID") & "") + 1, "00")
End If
cSQL = "INSERT INTO [Register](ID,FName,LName,[Login],[Password]) " & _
"VALUES('" & cID & "','" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" &
Text4.Text & "') "
Else
cSQL = "UPDATE [Register] SET FName='" & Text1.Text & "',LName='" & Text2.Text &
"',[Login]='" & Text3.Text & "',[Pass
word]='" & Text4.Text & "' " & _
"WHERE ID='" & Text0.Text & "' "
End If
Case 1
'ก ˁ
If MsgBox (" F ก
F
ก F", vbYesNo + vbQuestion, " F ") = vbYes Then
cSQL = "DELETE FROM [Register] WHERE ID='" & Text0.Text & "'"
Else
Exit Sub
End If
End Select
nConnect.Execute cSQL
Call ShowDataList
'
F
'
F
F
F
NewMode = True
Text0.Text = "Auto"
Text1.Text = ""
Form3 - 3
Text2.Text = ""
97
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End Sub

More Related Content

Viewers also liked

Endurance pony domenica 20 febbraio 2011
Endurance pony domenica 20 febbraio 2011Endurance pony domenica 20 febbraio 2011
Endurance pony domenica 20 febbraio 2011Ala Birdi
 
PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles Jean Michel
 
PHP #1 : introduction
PHP #1 : introductionPHP #1 : introduction
PHP #1 : introductionJean Michel
 
Architecture logicielle #3 : object oriented design
Architecture logicielle #3 : object oriented designArchitecture logicielle #3 : object oriented design
Architecture logicielle #3 : object oriented designJean Michel
 
Javascript #2.2 : jQuery
Javascript #2.2 : jQueryJavascript #2.2 : jQuery
Javascript #2.2 : jQueryJean Michel
 
Startup #7 : how to get customers
Startup #7 : how to get customersStartup #7 : how to get customers
Startup #7 : how to get customersJean Michel
 

Viewers also liked (11)

Endurance pony domenica 20 febbraio 2011
Endurance pony domenica 20 febbraio 2011Endurance pony domenica 20 febbraio 2011
Endurance pony domenica 20 febbraio 2011
 
Prezentacja1 wk
Prezentacja1 wkPrezentacja1 wk
Prezentacja1 wk
 
Children on the Move
Children on the Move Children on the Move
Children on the Move
 
Children on the Move
Children on the MoveChildren on the Move
Children on the Move
 
PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles
 
PHP #1 : introduction
PHP #1 : introductionPHP #1 : introduction
PHP #1 : introduction
 
CCA intro and content jun11
CCA intro and content jun11CCA intro and content jun11
CCA intro and content jun11
 
Architecture logicielle #3 : object oriented design
Architecture logicielle #3 : object oriented designArchitecture logicielle #3 : object oriented design
Architecture logicielle #3 : object oriented design
 
Children on the Move, Hans Van De Glind
Children on the Move, Hans Van De GlindChildren on the Move, Hans Van De Glind
Children on the Move, Hans Van De Glind
 
Javascript #2.2 : jQuery
Javascript #2.2 : jQueryJavascript #2.2 : jQuery
Javascript #2.2 : jQuery
 
Startup #7 : how to get customers
Startup #7 : how to get customersStartup #7 : how to get customers
Startup #7 : how to get customers
 

Similar to การประยุกต์กล้อง Webcamเป็นกล้องวงจรปิดผ่านทางอินเตอร์เน็ต

Kranky geeklondon build an app
Kranky geeklondon build an appKranky geeklondon build an app
Kranky geeklondon build an appTim Panton
 
Connect genericcamera
Connect genericcameraConnect genericcamera
Connect genericcameraldannel
 
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...Felipe Prado
 
Exploring web apps with Fiddler and Chrome Dev Tools
Exploring web apps with Fiddler and Chrome Dev ToolsExploring web apps with Fiddler and Chrome Dev Tools
Exploring web apps with Fiddler and Chrome Dev ToolsCristian Satnic
 
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...SpagoWorld
 
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...Davide Dalle Carbonare
 
IRJET- Wi-Fi based Home & Industry Surveillance Bot using Pi Camera
IRJET-  	  Wi-Fi based Home & Industry Surveillance Bot using Pi CameraIRJET-  	  Wi-Fi based Home & Industry Surveillance Bot using Pi Camera
IRJET- Wi-Fi based Home & Industry Surveillance Bot using Pi CameraIRJET Journal
 
IOT BASED ROBOTIC CAR USING RASPBERRY
IOT BASED ROBOTIC CAR USING RASPBERRYIOT BASED ROBOTIC CAR USING RASPBERRY
IOT BASED ROBOTIC CAR USING RASPBERRYIRJET Journal
 
Exploring the BatteryXPRT 2014 for Android Benchmark
Exploring the BatteryXPRT 2014 for Android BenchmarkExploring the BatteryXPRT 2014 for Android Benchmark
Exploring the BatteryXPRT 2014 for Android BenchmarkPrincipled Technologies
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
 
424185963-Introduction-to-VoLTE.pdf
424185963-Introduction-to-VoLTE.pdf424185963-Introduction-to-VoLTE.pdf
424185963-Introduction-to-VoLTE.pdfMohamedshabana38
 
V Legakis Presentation
V Legakis PresentationV Legakis Presentation
V Legakis PresentationVLegakis
 
VoIP security: Implementation and Protocol Problems
VoIP security: Implementation and Protocol ProblemsVoIP security: Implementation and Protocol Problems
VoIP security: Implementation and Protocol Problemsseanhn
 
What's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon TalkWhat's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon TalkSam Basu
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspectiveshwetank
 

Similar to การประยุกต์กล้อง Webcamเป็นกล้องวงจรปิดผ่านทางอินเตอร์เน็ต (20)

Kranky geeklondon build an app
Kranky geeklondon build an appKranky geeklondon build an app
Kranky geeklondon build an app
 
Connect genericcamera
Connect genericcameraConnect genericcamera
Connect genericcamera
 
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
DEF CON 27 - GRICHTER - reverse engineering 4g hotspots for fun bugs net fina...
 
Exploring web apps with Fiddler and Chrome Dev Tools
Exploring web apps with Fiddler and Chrome Dev ToolsExploring web apps with Fiddler and Chrome Dev Tools
Exploring web apps with Fiddler and Chrome Dev Tools
 
Kb015
Kb015Kb015
Kb015
 
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
 
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
fOSSa 2011: FI-WARE Methods and Open Source Tools to Build Future Internet Ap...
 
Alfredo paganophd 3y
Alfredo paganophd 3yAlfredo paganophd 3y
Alfredo paganophd 3y
 
IRJET- Wi-Fi based Home & Industry Surveillance Bot using Pi Camera
IRJET-  	  Wi-Fi based Home & Industry Surveillance Bot using Pi CameraIRJET-  	  Wi-Fi based Home & Industry Surveillance Bot using Pi Camera
IRJET- Wi-Fi based Home & Industry Surveillance Bot using Pi Camera
 
MetroCluster in Clustered Data Ontap
MetroCluster in Clustered Data OntapMetroCluster in Clustered Data Ontap
MetroCluster in Clustered Data Ontap
 
IOT BASED ROBOTIC CAR USING RASPBERRY
IOT BASED ROBOTIC CAR USING RASPBERRYIOT BASED ROBOTIC CAR USING RASPBERRY
IOT BASED ROBOTIC CAR USING RASPBERRY
 
WebRTC 101
WebRTC 101WebRTC 101
WebRTC 101
 
Exploring the BatteryXPRT 2014 for Android Benchmark
Exploring the BatteryXPRT 2014 for Android BenchmarkExploring the BatteryXPRT 2014 for Android Benchmark
Exploring the BatteryXPRT 2014 for Android Benchmark
 
Mobile Trends 2012
Mobile Trends 2012Mobile Trends 2012
Mobile Trends 2012
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
424185963-Introduction-to-VoLTE.pdf
424185963-Introduction-to-VoLTE.pdf424185963-Introduction-to-VoLTE.pdf
424185963-Introduction-to-VoLTE.pdf
 
V Legakis Presentation
V Legakis PresentationV Legakis Presentation
V Legakis Presentation
 
VoIP security: Implementation and Protocol Problems
VoIP security: Implementation and Protocol ProblemsVoIP security: Implementation and Protocol Problems
VoIP security: Implementation and Protocol Problems
 
What's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon TalkWhat's New with Windows Phone - FoxCon Talk
What's New with Windows Phone - FoxCon Talk
 
WebRTC: A front-end perspective
WebRTC: A front-end perspectiveWebRTC: A front-end perspective
WebRTC: A front-end perspective
 

Recently uploaded

BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxSayali Powar
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesVijayaLaxmi84
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfChristalin Nelson
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxAnupam32727
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvRicaMaeCastro1
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQuiz Club NITW
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptxDhatriParmar
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWQuiz Club NITW
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Celine George
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6Vanessa Camilleri
 

Recently uploaded (20)

BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptxBIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
BIOCHEMISTRY-CARBOHYDRATE METABOLISM CHAPTER 2.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
Sulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their usesSulphonamides, mechanisms and their uses
Sulphonamides, mechanisms and their uses
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Indexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdfIndexing Structures in Database Management system.pdf
Indexing Structures in Database Management system.pdf
 
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptxCLASSIFICATION OF ANTI - CANCER DRUGS.pptx
CLASSIFICATION OF ANTI - CANCER DRUGS.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnvESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
ESP 4-EDITED.pdfmmcncncncmcmmnmnmncnmncmnnjvnnv
 
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITWQ-Factor General Quiz-7th April 2024, Quiz Club NITW
Q-Factor General Quiz-7th April 2024, Quiz Club NITW
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
Unraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptxUnraveling Hypertext_ Analyzing  Postmodern Elements in  Literature.pptx
Unraveling Hypertext_ Analyzing Postmodern Elements in Literature.pptx
 
prashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Professionprashanth updated resume 2024 for Teaching Profession
prashanth updated resume 2024 for Teaching Profession
 
Mythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITWMythology Quiz-4th April 2024, Quiz Club NITW
Mythology Quiz-4th April 2024, Quiz Club NITW
 
Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17Tree View Decoration Attribute in the Odoo 17
Tree View Decoration Attribute in the Odoo 17
 
ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6ICS 2208 Lecture Slide Notes for Topic 6
ICS 2208 Lecture Slide Notes for Topic 6
 

การประยุกต์กล้อง Webcamเป็นกล้องวงจรปิดผ่านทางอินเตอร์เน็ต

  • 1. ก Fก F WebCam ˈ ก F ก ก F F F ˈ F ก ก ก ก ก ʽ F F ก ก ก ก ก ก F . .2553 . . 2553 F
  • 2. MODIFICATION OF WEBCAM CAMERA TO INTERNET CLOSED-CIRCUIT TELEVISION Mr. Sittisak Phumhirun Mr. Panu Rungsawang Project Report Submitted in Partial Fulfillment of the Requirements for the Bachelor s Degree of Science in Information and Production Technology Management Department of Information and Production Technology Management College of Industrial Technology King Mongkut s University of Technology North Bangkok 2010
  • 3. F F ก ʾก :ก : ก Fก F WebCam ˈ ก F ก F F F F ก F F : :ก :ก : 2552 F ก ก ก ˈ F กF ก ก ก F ก .................................................................. F ( F ) ก F ก ก ก F ʽ F F .................................................................... ( F F F ) ก ..................................................................... ก ( F ก F) ก ..................................................................... ก ( F ) ก ..................................................................... ก ( F F ก F) ก ก ก
  • 4. Project Title By : Modification of Webcam Camera to Internet Closed-Circuit Television : Mr. Sittisak Phumhirun Mr. Panu Rungsawang Project Advisors : Ms. Supitcha Cheevapruk Ms. Thitima Asavapromthada Major Field : Information and Production Technology Management Department : Information and Production Technology Management Academic Year : 2009 Accepted by the College of Industrial Technology, King Mongkut s University of Technology North Bangkok in Partial Fulfillment of the Requirements for the Bachelor s Degree. ......................................................... Director of College of Industrial Technology (Assoc.Prof. Sivilai Thanormsuay) Project Committee .................................................................... Chairperson (Assoc. Prof. Anan Wetwatana) .................................................................... Member (Ms. Supitcha Cheevapruk) .................................................................... Member (Ms. Thitima Asavapromthada) .................................................................... Member (Ms. Hathairat Ketmaneechirat)
  • 5.
  • 6. F F ก ʾก : ก : F : : ก :ก : 2552 ก ก Fก F WebCam ˈ ก F ก F F F F ก F F ก ก ʽ F F ก ก F ˆ F F ก F ʽ F F F F ก ก ก F F F ก F WebCam F F ˈ ก F ก ˈ ก F ʽ ก ก F ก ก F WebCam F F F F F F ก F F ก ก F ก ก ก ก F User F on demand F Admin ˈ F ก F ก ก ʽ F F F F ก F ก ก F ก F F F F ก F F F ก F ˈ ก F ʽ Fก F F ก F Fก F ก ก Visual Basic ก F ก F F Real time ( ˆ F User F 10 x 10 ก F F WebCam Fก Fก ก F ก F ) ก
  • 7. Project Title By : Modification of Webcam Camera to Internet Closed-Circuit Television : Mr. Sittisak Phumhirun Mr. Panu Rungsawang Project Advisors : Ms. Supitcha Cheevapruk Ms. Thitima Asavapromthada Major Field : Information and Production Technology Management Department : Information and Production Technology Management Academic Year : 2009 Abstract Nowadays closed circuit televisions that are popularly used costs very high. Some of them have no capacity to let users read through the internet system. If the users prefer to read the previous incidents, there is restriction. As a result, this study was aimed to modify a Webcam camera to function as a closed circuit television linked with the internet system that could be used effectively based on its details or aspects in an appropriate area. A Visual Basic program was designed and developed to be connected to the camera with the connection of the ports between a various networks for the users to read both real-time incidents and those previous one on demand. The administration section was responsible for the users application. The result of this study showed that the developed camera had the capacity to record the incidents though the internet system very clearly in the room with the dimension of 10x10 meters. Moreover, the users could read the previous incidents effectively as needed.
  • 8. ก ก F F F FF F F ˈ F ก F F ก F ก F F F F F ก ก F F F F ก ก F F F F กF ˈ F ˈ ก ก F F F F F ก F ก F F ก ก F ก F ก ก F F ก F F F F Fก ก F F F
  • 9. F F F ก ก ก ก 1 1.1 1.2 1.3 1.4 1.5 2 2.1 2.2 2.3 2.4 2.5 2.6 2.7 3 ˈ ˆ F ก F ก ก F ก ก F ก F F ʽ (CCTV) (Web Camera) F F F (Server) DNS (Domain Name Service) ก Microsoft Visual Basic ก F ก 3.1 ก 3.2 ก 3.3 ก F F ก ก ก ก F 1 1 2 2 2 3 4 4 6 7 17 21 25 35 37 37 38 45
  • 10. ( F) 3.4 ก 3.5 ก 4 ก 4.1 4.2 5 F ก ก ก F F F ก Fก F WebCam ก ก ก 5.1 5.2 F ก ก F F 46 49 57 57 62 69 69 69 ก ก 70 ก 71 72 78 กก ก ก F ก Appserv ก Cam Server
  • 11. 2-1 2-2 2-3 3-1 4-1 4-2 F F IEEE ก F (Attribute) ก ก ก ก F IEEE 802.3 Ethernet ก F ก F A (3 F ก ) F ก F B (5 F ก ) F F F 15 16 17 45 65 67
  • 12. 2-1 ก F ʽ 2-2 ก F ʽ F 2-3 Web Camera 2-4 F LAN 2-5 F MAN 2-6 F WAN 2-7 ก F Peer To Peer 2-8 ก F Client Server 2-9 ก F F Bus 2-10 ก F F Ring 2-11 ก F F Star 2-12 ก F F Hybrid 2-13 F ก F 2-14 F ก F F 2-15 ก ก 2-16 ก F 2-17 ก F F F 2-18 ก F User F Internet F 2-19 ก Domain Name Service 2-20 F ก F F ADSL 2-21 ก F Dynamic DNS Client Zyxel P660R 2-22 ก ก Dynamic DNS Client 2-23 ก Fก F 2-24 F VB 6.0 2-25 ก F ก F New Project 2-26 ก F Standard 2-27 ก F Edit Lan F 4 5 6 8 9 9 10 10 11 11 12 12 13 13 14 14 15 20 21 22 23 24 27 28 29 29 30
  • 13. ( F) 2-28 ก F Debug 2-29 ก F Form Editor 2-30 Control 2-31 F F VBIDE 2-32 Project Explorer ก F 2-33 F F Alphabetic 2-34 F F Form Layout 2-35 F F Immediate 2-36 F VBIDE MDI 2-37 F VBIDE SDI 3-1 Flow Chart ก F F 3-2 ก F F F F 3-3 Context Diagram 3-4 Data Flow Diagram 3-5 Data Flow Diagram Level 1 Process 1 (ก F F ) 3-6 Data Flow Diagram Level 1 Process 2 (ก F ˆ ) 3-7 Data Flow Diagram Level 1 Process 3 (ก F F ) 3-8 Data Flow Diagram Level 1 Process 4 (ก กF / F ) 3-9 Data Flow Diagram Level 1 Process 5 (ก ก F ก F) 3-10 F ก ก 3-11 F ก User 3-12 F Login F F 3-13 F ˆ (Real time) 3-14 F FF 3-15 F FF ก ก 3-16 ก F ก ก 3-17 ก ก F ก User F 30 30 31 32 32 33 34 34 35 35 39 40 41 42 43 43 44 44 45 46 46 47 47 48 48 49 49
  • 14. ( F) 3-18 3-19 3-20 3-21 3-22 3-23 3-24 3-25 3-26 3-27 3-28 3-29 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 4-10 4-11 4-12 ก ก ก F F FF F F F ˆ ก ก ก F F F F F F F F F F F ก (Server) ก Folder F F ก User F F F ˆ ก ก (Real Time) F F F F Device Video Path Video Limit F ก User F F http://192.168.0.253/webcam/login ก F F ก F F ก F Fก F F ก F F F ˆˉ Client F F ก F ก F F F ก F A (3 F ก ) ก B (5 F F F 3x7 ก ) F 50 50 51 52 52 53 53 54 54 55 55 56 57 58 59 59 60 60 61 61 62 62 63 64
  • 15. 1 1.1 ˆ ˈ ˆ ก F ʽ F ก F F กF F F F F ก ก F ʽ F ก ก ก F ก F F F ก F F FF ก F ʽ F F ก F F F ก F F ก ก ก ก F กก F ʽ ก ก ก F ʽ F F ก ก ก F ก F F ก F F ก F ก F ก F WebCam ˈ ก F ʽ F ก F WebCam ˆ (CCTV) F F ก F ˈ Fก F WebCam ก F F กก F ก F F F F F ก Fก F ก F F F F ก ก F F ก F F ก F ˆ F ก F F ก F ก F FF F FF ˈ F F ก ก ˆ F ก ก ก F ʽ F F F ก F ˆ ʽ Fก F F F ก F F ʽ F ʽ ʽ ก ก ก F F ˈ F ˈ ก F กFก F Fก ก F Fก F F ก F F F ʽ Fก F F ก F ʽ ก F ก F WebCam F ก F F F F F ก F ก F F F F
  • 16. 2 1.2 F ก ก ก ก ก ก ก F 1.2.1 1.2.2 F 1.2.3 1.2.4 1.2.5 1.3 ก ก ก ก ก Visual Basic ก ก F WebCam ก Macromedia Dreamweaver ก ก F F F ก F F F ʽ F Fก F WebCam F F ก 1.3.1 ก IP Fก ก F F F ก F ก ก Server F Dynamic DNS ก F 1.3.2 ก F ก ก ก Fก F Admin User F User F F Real Time On Demand F F F F F กF F F Admin F ˈ F ก F ก F ก ก กF F F ก ก ก ก F F F F F กF F ก กก F ʽ Real Time On Demand F ก ˈ F กF ก ก ˈ ก ก Fก F F F 1.3.3 1.3.4 1.3.5 ก 1.4 ก F ก ก Host Web Server ก F ก ก F ก ก F ก F ก1 . F 60 MB. F 1 ก ก ก F F 1 GB. ก 1.4.1 DNS ( Domain Name Service ) F F www.company.com กF F F (DNS Server) F2ก F ก F F 1 GB. F F 24 . F 1.44 GB. Server ก F 203.156.24.52 F ก F
  • 17. 3 1.4.2 ก F ก F F Fก F (Dynamic DNS) ˈ F F F F F ก ก ก F ก F ก 1.4.3 F (WebCam F ก Web Camera) ก F F F F ก ˈ ก F F F ( ) F ก F F F ˆˉ F F ก F ˆ F ก F F F F 1.4.4 VPN (Virtual Private Network) F F F ก (WAN - Wide Area Network) F F ก ก ก F VPN ก F F ก F F F ก F F Leased line 1.5 F 1.5.1 ก F ก ก F CCTV 1.5.2 F Server 1.5.3 ก F F F F ก F ˈ F ก ก ก F ก DynDNS (Dynamic DNS) ก F F F F F ก F ก Fก F ก F F F F Internet ก ก ก
  • 18. 2 ก ก F F ˈ F F F F F ก F 2.1 F ʽ (CCTV) 2.2 (Web Camera) 2.3 F 2.4 F F (Server) 2.5 DNS (Domain Name Service) 2.6 ก Microsoft Visual Basic 2.7 ก F 2.1 F ʽ (CCTV) ก F ʽ (CCTV) F ก Closed-Circuit Television ก ˈ ก F ก F Point to Point F ʽ F ก F ˆ 2 ก 2.1.1 ก F Fก (Fixed Camera) 2-1 ก F ʽ F F ก ก ก F
  • 19. 5 2.1.2 F (Moving Camera) 2-2 ก F 2.1.2.1 Fก F ก F F กF 10 F ʽ F F (Pan & Tilt unit) ˈ ก F F ก F Fก Pan & Tilt unit กF F ก F กF F ก F ก ก F F F F ก F F ˈ F ก F ก ก ก ก ˈ F ก F F F ก F F ก F ˈ F F Pan & Tilt unit F F Fก F กก F ก F F F ก F F ก F ก 2.1.2.2 F F (Zoom Lens) ˈ F F ( ก ) F Fก ก F Pan & Tilt unit F ก ˈ ก F F ก F Motorized Zoom Lens ก ก F Motorized Zoom Lens ก F ก F F Motorized Zoom Lens ก F ก F F F ก F Motorized Zoom Lens ก F ก F 6 - 35 . . (6 F ) F ˈ F ก กF F ก F ก ก F Motorized Zoom Lens ก ก F 6 - 60 . . (10 F ) F ก F ก F F ก ก F Motorized Zoom Lens ก ก F 6-123 . . (21 F ) ˈ F (Available online at http://www.matcom.co.th/ contents.php?id=300.htm, 2008)
  • 20. 6 2.2 (Web camera) 2-3 Web Camera 2.2.1 F F F ก Fก F ก F F ก ก ก ก F F F F ก ก F ก F 2.2.1.1 ก ˈ ˈ ก F F F ก F ก ก ก F ก FF F F F ก F F ˈ ก F ก F ˈ ก F Fก ก F ก 2.2.1.2 F ก F F F ก ก F F F ก 3 ก F Fก ก F 3 ˆ F F ก ก F F ก ก F F ก ก F ก ก F F F ก ก F F F ˈ F ก ก F F 2.2.1.3 F F F ก F F F2 CCD CMOS F Fก ก ก CMOS ก F CMOS ก ก F 2 F ก Color CMOS Censor ก F 110,000 ก ( 367 x 291 ) F VGA Color CMOS Censor F ก F 350,000 ก ( 655 x 493) ก F ˈ F ˈ 4 F FF ก ก CLF
  • 21. 7 ก ก F CCD ˈ ก ก F F F F ก F F CMOS 2.2.1.4 F ก F F ˈ F USB F ก F F F F ก F F view.php, 2008) 2.3 F F USB Fก CMOS กF F noise F ก ก F ก F ˆ Fก ˈ F 1.1 Fก F 2.0 F WiFi Wireless F (Available online at http://www.tteen.net/ F 2.3.1 F F ก F F F FF F F ก F F F F F ก F F F ก ก F F F F ก ก F ก F F ก F F ˈ LAN F ก ก F F ก F F ก ก F Home Network F F (Local Area Network) FF F F ˈ F ก F ก F Fก F ก ก F FF F F 2.3.1.1 ก F ก F ก ก F ก F F F FF ก ก F F ก F F F F F ก F FF F F F ( ก ก ˈ F ) 2.3.1.2 ก F F F ก ˈ F F ก F F F F ก ก ก F F F ก F F ก Fก F ก F F ˆ ก F ก F ก F ก ก F ก F F กF ก ก F 2.3.1.3 ก F F F ˈ F F ก F ก F ˈ F F F ก ก F F กF F F Home Network Home Office ก F ก ก
  • 22. 8 2.3.1.4 ก F F F F F F ก F F ก F ก F ก ˆ F ADSL 2.3.2 F ก F ก F FF F Fก ˈ F F F F ก F ก ก ก F F F ก F ก 1 Fก ˈ ก Fก F F F ก F ก F F ก ก F ˈ ก F F2 F ก F F ก F ก F F F F F ˈ 3 F ก 2.3.2.1 LAN (Local Area Network) F F ก ˈ ก F F F ก F ก ˈ F F ก ก F F F ก 2-3 ก ก F F F F ก ก Fก F F ก F ก ก F ก F ก ก F ก F F ก ก - F F ก ก F F LAN ก ก F ก 3 ก - F F ก F Ingle Building LAN ˈ ก F ก F F ก F F Multiple building LAN ˈ ก F F F F ก F Backbone 2-4 2-4 F LAN
  • 23. 9 2.3.2.2 MAN (Metropolitan Area Network) F F LAN F Fก F F F F ก ก F ก ก - F F F F (Cable television) F F F ก F F (Switching element) F ก F F 2-5 ( ก F ก F ก F F ก Fก F ก F ก ˆ F MAN 2.3.2.3 WAN (Wide Area Network) F ˈ ก ก F ˈ ก F F ก กF F F (Host Computer) F F ก กF F F ˈ ก ก F F F F ก F F F F ก - F F F F F กก F F F WAN ก F ก F F (Transmission line) ก F F (Switching elements) F, 2551 : 174-178) 2-6 F WAN
  • 24. 10 2.3.3 F 2.3.3.1 Peer To Peer ˈ F ก F F ก ก F F F F F F F ก Peer To Peer ก F (Distributed System) ก ก F F Fก F ˆ ก ก ก F ˈ ก F ก F F F ก Peer To Peer Windows for Workgroup Personal Netware 2-7 ก F 2.3.3.2 Client - Server ˈ ก Fก F ก F F F F F F ก ก F ก F F 2-8 ก Peer To Peer Distributed Processing ก F F Fก F F F ก Fก ก F F ก F F F F F F Fก F F F Client Server
  • 25. 11 2.3.4 ก F 2.3.4.1 F Bus ก F ก F ก ˈ Node (Node C) F F F Node C F F F F F F F ก F IBM ก ก ˈ IBM ก F F Ring ก F ก F F F กF F F F F F Token Ring F F F F F Fก F 2-9 ก 2.3.4.2 F LAN Topology ก1 F F ก F (Node A) F ก Node C Bus ˈ ก F ก ˆ F F F ก ˈ ก F Ring ก F F F ก F 2-10 ก ก F Ring F F F F ก ก
  • 26. 12 2.3.4.3 Star ก F F ก F F Hub ก F F Hub ˈ ก F ก F ก 2-11 ก F 2.3.4.4 F ก F F Network 120-156) F ก F Hub ˈ F F ก ˈ UTP (Repeater) ˆ ก กF F Hybrid ˈ ก F F Bus Ring F กF F F F Hierarchical Tree F 2-12 ก F Star F F Star F ก ก F Fก ก Fiber Optic F Switch ˈ Hybrid F F F F F ก F Hybrid ( F, 2551 :
  • 27. 13 2.3.4 2.3.4.1 F ก ก ก ก ก ก 106 Hz F F ก F F F F ก Fก ก F F ก ก F F F ก F ก F F กF ก) ก F F F ก ˂ ˆ (Twisted Pair) ก F ก F ก 1 F F Fก F ˂ก F F F ก F ก F F F F ก F ก ก F 2-13 ) ก ˂ ก ก F F ก Fก F F F F ก F F ก ˈ 3 F กF ก F F ก ก ˂ ก F F ก ˂ F F 105 Hz F 12 F ก F ก F F F F F F F F F F ˈ ก F Fก ก F F ก F F ก ก F 2 (Shielded Twisted Pair : STP) ˈ F 2-13 ˂ ก ก ก F F F ก F Fก ก 2-14 (Unshielded Twisted Pair : UTP) ˈ ก 2-14 F ก ก F F ˂ F F กF ก F ก F F F
  • 28. 14 2.3.4.2 ก FF ก ก ก ก F F F 75 ˂ ก ก ˈ ก F F ก ก F F F F ก ˂ ˂ F F F F 2 F F 50 ก F F ก ก ก ˈ F 500 Mhz. Fก F ก ก F F F F F F F F F F F 2-15 ก 2.3.4.3 F F F F F F F F ก F F 2ก F F F ก (Fiber Optic) ˈ ก F F กF F F ก ˆ F F F ก 10 ก F F FDDI F F F 100 ก F Fก ก ก F F F F F ก F ˈ ก ก F ก ก 2-16 ก F
  • 29. 15 ก F 2-17 F F 2.3.5 Lan Protocol - Ethernet ˈ Lan F F ก 3 ก ARCnet Token Ring Ethernet ก ก ก F ก F F ก F Topology ก ก F ก 2-1 2-1 F ก ก IEEE ก F F ARCnet Token Ring Ethernet IEEE 2.5 Mbps 4 16 Mbps 10 Mbps Coaxial , UTP UTP , STP Coaxial , UTP ก F Ethernet F F IEEE 802.3 F ก ก Xerox ก F F F 10 Mbps F ˆ F ก F Fast Ethernet Gigabit Ethernet Topology Star , Bus Ring , Star Bus , Star Ethernet ʾ 1970 ˈ
  • 30. 16 IEEE 802.3 2-2 ETHERNET 10 10 Mbps Mbps ก F Fast Ethernet system IEEE 802.3 ก F Fast Ethernet system IEEE 802.3 ก F F Fก ˈ 10 Mbps ก F Fast Ethernet system IEEE 802.3 F (Coaxial Cable) (Fiber Optic Cable) F 10 Mbps ก F Fast Ethernet system IEEE 802.3 Ethernet ก ก F (Twisted Fก F ก Pair Cable - UTP) กF BUS ก Ring ˈ F F ก F Ethernet ก F F F ก F F F F F F ก F Ethernet ก F F F ก ก F F F 10base2, 10base5, 10baseT, 10baseFL, 100baseTX, 100baseT4 100baseFX Fก ก F F ก F F F F F F 10base2 ˈ F 10 Mbps. F Coaxial กF Thin Ethernet ก F (Topology) ˈ BUS ก F F 185-200 ˈ F (Available online at http://school.obec.go.th/mrPaisan/elearning /information/content/internet1.htm, 2008)
  • 31. 17 ก 2-3 F Ethernet ETHERNET ก F 10base2 ก F F 10 Mbps ก F F 185 - 200 Topology F BUS F Cable Thin Coaxial ก Thin Ethernet Cheapernet 10base5 10 Mbps 500 BUS Thick Coaxial Thick Ethernet 10baseT 10 Mbps 1000 STAR Twisted Pair (UTP) Thick Ethernet 10baseF 10 Mbps 2000 STAR Fiber Optic Thick Ethernet 100baseT 100 Mbps 1000 STAR Twisted Fast Ethernet Pair (UTP) 2.4 F F (Server) 2.4.1 Web server ก HTTP (HyperText Transfer Protocol) FF F F F ก ก F Browser F ก http://www.thaiall.com http://localhost ˈ F ก F ก Web Browser F F ˈ ˈ F ก F F ʽ ก Web Apache Web Server Microsoft Web Server
  • 32. 18 2.4.2 DNS Server Domain Name System Server ˈ ก ˈ IP ก ก ก Cache Local ก ก F F ก 2.4.3 FTP (File Transfer Protocol) ก ก - F F ʽ FF F ˈ ก F F F ˈ F F F F F F ก Anonymous ˈ Fก กF ˈ F F F F F ก FTP F F ʽ ก FTP ʽ TCP Port 21 F ก F FTP 2 Mode 2.4.3.1 FTP Standard Mode ก F Server F ก Client F Port 20 ˈ Out Going Port F Port ˆˉ Client F F ก ก F F Client Firewall F ก FTP ก F F F 2.4.3.2 FTP Passive Mode ก F Client ˈ F F Server F Port F F ก ก F F 2.4.4 Mail Server ก - F ก ก F F F F F Attach File ก Address Book ˈ F F Mail Server ˈ Fก F hotmail.com thaimail.com ˈ F 2.4.5 SMTP Server Simple Mail Transfer Protocol Server ก F E-Mail ก SMTP F F F F ก Fก IP F ก Fก F SMTP F F ก SMTP ก Fก ก Fก F ก ก SMTP กF ก F F Fก Relay F F F "Open Relay" F F F F ˈ F F Relay F F ก F F ก SMTP Server ก F SMTP F F Bomb Mail Mail Box ˂ ก SMTP F F
  • 33. 19 2.4.6 POP Server Post Office Protocol Server ก - F ก Mail Server ก ก ก F F Mail F PDA F F F F Mail thaimail.com ˈ Web-Based Mail ʽ F E-Mail F ก Web F ʽ F Outlook F F 2.4.7 Database Server ก F ʽ FF F F กF ก ก F F F กF MYSQL Microsoft Access ˈ F F F F ก F F F F F ก 2.4.8 Proxy Server F ก F กก F ก F F F ก F ก ก F F F Proxy Server F F Proxy Server F F ก ก Fก F ก F ก F F F กก F Proxy Server F ˈ ก F ก ก F F ˈ F Proxy Server F ˈ Cache Server F ก F F F F ก ก F F F Proxy ก ก F F ก ก Cache F F F F ก ก ก Cache F F Proxy Server F Linux F Squid ก F ก Port 3128 ˈ F Proxy server ก F Address F package F Local Host Address Package F Local Host ก Proxy Server ก Caching F Local Host F F ก F ก ก Local Network F F ก ก F F ˈ 2.4.9 NAT (Network Address Translation) ก ก IP ก IP Sharing F F F Local IP Fake IP F Real IP F F ก ก ก F ก Local IP F ก ก F ก ก F F ก F ก F Real IP ก ก ก ก F F ˈ NAT Server F Firewall ก ˂ ก F Local IP Fก F กก ก F F F IP NAT Server F F F ก F ก ˈ NAT Server F ˈ F F Cache Server ก F ˈ Proxy Server
  • 34. 20 ก F F กF F ˈ NAT F ก F ˈ NAT Server F WinGate, WinRoute, WinProxy ICS (Internet Connection Sharing) ˈ F 2.4.10 DHCP server DHCP (Dynamic Host Configuration Protocol) F ก ก IP Address กF ก F TCP/IP DHCP Server F ก IP F F F ˈ ก F ก Boot ก IP Address, Subnet Mark, DNS Default Gateway ก F กก DHCP Server 2.4.10.1 ก F DHCP Server F F DHCP Discover F IP Address 2.4.10.2 DHCP Server F IP F F F F F DHCP Offer ก F ก 2.4.10.3 ก F IP ก F ก DHCP Request F F 2.4.10.4 DHCP server F DHCP Ack ก F ก F F F F (Available online at http://www.vcharkarn.com/vblog/41000,2009) 2-18 ก F User F Internet F Lan
  • 35. 21 2.5 DNS (Domain Name Service) 2.5.1 DNS (Domain Name Service) DNS ˈ ก F ก F F F F F F F F F F F F www.yahoo.com ˈ F F F F F F ˈ 2 F F F) www F yahoo.com F F ˈ F F F F ก F F ˈ F F ก F F (Web Server) F F (IP Address) ˈ ก DNS ˈ ก F F F Fก F F F 2-19 ก F F F F FF F( ก F F F F ˈ ก F ˈ F ก ก Domain Name Service F F ก F F F 2 (Domain Name Registration) F F F F F (Real IP Address) F ก ˈ ก ก F ก F ก F F F
  • 36. 22 F F F ก F F ก (Fix Address) F F ก F F F ก F F F F F FF F ʾ ˈ F ก ก F SME ก F 2.5.2 Dynamic DNS F F ก DSL ก ˀˉ ˆ ก F F F ก ก SME ก F F F ก F F F ก ก F ก ก ก F Fก F F ก ก F F F F ก F F F ก F F F ˆ ก F กก F F F F F F F F F F ก ก F ก F กF F F ก F Dynamic IP Address F ก F ก F 203.177.128.51 F F ก F 203.177.128.96 ก ก F F F F F F F F F F ก 2-20 F ก F F ADSL F F ˈ F SME F F ก ˈ F F
  • 37. 23 ˆ ก F กF F F F F F FF F F ก Dynamic DNS F ʽ F ก ก F thaiddns.com dyndns.org no-ip.com กก ก Dynamic DNS ก DNS Fก F F ʽ F ˈ ก กF ก ก F F F ( F homelinux.com) F ก F ก Fก F ˈ ˈ ก ก F F F (mycom.homelinux.com) F ก ก ก ก ʽ F F ก F F F F กF F F F ก F ก F F F F F ก Dynamic DNS F F F F F F F F F ก Dynamic DNS F F ก F ก F F F ก 2.5.3 ก Dynamic DNS Client ก F F ก F F F F ก F F F F ก F F F ก Dynamic DNS ˂ F ก F ก F F ก F ก Dynamic DNS Client ก F F ก ก ก F ˈ F ก F F ก F F ก F F Perl Java F ก Fก F F F F Dynamic DNS Client F ก F กF Zyxel P660R Fก F F F F 2-21 2-21 ก F Dynamic DNS Client Zyxel P660R กF ก F F FF F F
  • 38. 24 F F ก ก ก F ก F F FF ก F ก F F F ก F F ก F ก ก F F ก ก F F กF ก DNS F 2-22 ก 2.5.4 F ก ก F F F F F ก Dynamic DNS F F ก Dynamic DNS F F F F F F ˈ ˆ F ก Dynamic DNS Client Dynamic DNS F F ก F F ADSL ก F Fก F ˈ F F ก ก ก F ก F F Fก Upstream F F 128 k. F ก ก F F F ก ˈ F F F F ʽ ʽ F ก กF ก F FF ˈ ก ก ก ก F F ก F ˈ ก F (Value Added) Fก F Fก F F ก F F F F ก (Available online at http:// www.itdestination.com/articles/dynamicdns,2008)
  • 39. 25 2.6 ก Microsoft Visual Basic ก ก ก ก ก F F F F F ก ˈ F ก FF F C C++ ˈ F F F Fก F ก F กF ก F Command Line ก F ก F F F ก F ก F F ก F F F ก กF F F ก F F F ก F ก ก ˈ F F F F ก F F ก ก Visual Basic 1.0 F F F ก ก ก F F ˈ F F ก F F ก F ก ก ˈ F F ก F ก F F F ก F F F F ก F ก กก ก ก F ก ˆ Visual Basic F F 6.0 F VB ก ก กF F ˆ F F ʾ F F F ก ก VB ˈ ก F F F F ก F F ˈ ก F F F ก F VB F F DHTML F Run Web F ก ก ActiveX F ก VB F Fก F ก F F VB ก F F F ˈ F F F F ก F F F F ก ก F F F ก F ก F F VB F F กF (Controls) F ก F กF ก F F ก F ก F F VB ˈ F ˆ ก F F ก F ก ก ก F VB ˈ ก ก F F TextBox Label ComboBox ˈ F ก F กF ก ʽก F F (Graphic User Interface-GUI) ก F F F F ก F ก F F F ก
  • 40. 26 ก ก F F F( ก VB กF ก ก FF ก ˈ F ˈ F Event) ˈ กก ก กF F ก (Event-Driven Programming) F Dialogbox Toolbars F ˈ ก F F ก F (Object VB ˈ F ก F ก F F F ก F ก F F ก ก ˈ F Fก F (Properties) (Methods) F F ก ก F Fก F ก F F กก F กF F ก Textbox ˁ OK Model) ก ก F กF ก F F ก (Properties) F F ก ก F ก F F ก F F F F F F ก F VB ก F (Code) ก F ก ˈ F ก ก (procedure) F ก ก ก F F F F F ก F ก ก F F F F กF ก ก (Object Oriented Programming-OOP) F VB F ˈ OOP F F ก F ก F Visual Basic F ก C++ ก ก F ก F ก F ก ˈ F FF F ก ก F (Debug) ก กF ก F F F ก F F F ก F ก FF ก F 2.6.1 F (Form) ก F (Object) F F 2.6.1.1 ก F F (Text Box) F F 2.6.1.2 ˂ ก (Label) F F 2.6.1.3 ˁ (Command Button) F F ˁ ก 2.6.1.4 F F (Combo Box) F FF F ก 2.6.1.5 ˁ ก (Option Button) F ˈ ก ก 2.6.1.6 ก F ก (Check Box) F ˈ ก ก F 2.6.1.7 ก F (Image) F ˈ F กF F F F F ก F F F
  • 41. 27 2.6.2 (Name), ก ก (Object), ก F ˆ กF ก 2.6.3 2.6.4 (Object) ก F F F F ก 2.6.2.1 (Properties) (Object) F ก F (Width) F F 2.6.2.2 ก F (Event) ก F ก กก F F ก ก (Object) F ก (Click) ก F F (Key Press) ก F Fก F F ˈ F 2.6.2.3 ˆ กF ก (Method) ก F F (Object) F (Add Item) F F (Combo Box) ˈ ˆ กF F ก F ก (List) F F (Combo Box) ˈ F F (Object) (Method) ก F ก ก (Object) ก F ก VB 2.6.3.1 File -> New Project F F ก F F 2.6.3.2 File -> Open Project F ʽ ก F F F 2.6.3.3 File -> Save Project F ก ก F 2.6.3.4 File -> Save Form F ก F 2.6.3.5 File -> Print F F Source Code ก F 2.6.3.6 File -> Make Project.exe F F F ก F Project 2-23 ก F F F
  • 42. 28 F F ก Standard.exe กF ˈ F F (Compile) F F ก .exe ก F F F F (Environment) VB 6.0 F ก F Integrated Development Environment VBIDE 2.6.5 F F VBIDE VBIDE ก F F F F Properties F F Project Explorer ก ก ˈ F ก VB 6.0 F 2-24 F F F (Menu Bars) ก F ก F ˈ 2.6.6 F F F F Project ก ˈ F VBIDE F F F F F F F ก ก F ก ก VB 6.0 ก F ก F ก ˁ F F F F ก F F ˈ ก ก F VBIDE F New Project (New Project Window) New Project ก F VB ก F F F ก F ก ก Standard.exe ˈ F F F F กก F F ก .exe F F (Tool Bars) ʽ ก F, File/New ก
  • 43. 29 ก F 2-25 F New Project 2.6.7 F (Tool Bars) F ˈ F ก ก ก F F F F ก ก View/Toolbars ( F ก ก F F Pop-up ก F ก F ก ) ˁ F F F F ˈ F F F F F F ˁ 2-3 (ToolTip) ก ˁ F F ก F ˈ 4ก F F 2.6.7.1 Standard FF ˈ F ก (default) F F ก F กF ก F ก ก ก F F ก ʽ ก F, ก F ˈ F ˈ ก F กF F ก File Project Debug Run Tool ˈ F 2-26 ก F Standard
  • 44. 30 2.6.7.2 Edit ก Cut Paste ก F F F ˈ F F ก ก Fก F Edit ก 2-27 2.6.7.3 Debug ˈ ก F F F Code Editor ก F F F F F ก ก 2-28 2.6.7.4 Form Editor F F F ˈ F ก ˈ ก F F Immediate F ก F ก ก F F Run Stop Pause F F F F Debug Fก F 2-29 F Edit F ก Format F F Form Editor F 2.6.8 F ก F (Tool Box) F ก F ˈ (Controls) F ก F F ก ˈ Visual Basic ก F F F F ก F F VB ก ก ˈ ก F F F2ก F F ก F Fก ก F F
  • 45. 31 2-30 Control 2.6.8.1 (Intrinsic controls) ˈ ก VB ก F ก ก F F FF F F F (Remove) ก ก VBIDE F ˈ F ก ก F ก 2.6.8.2 ActiveX (ActiveX controls) ˈ ก ActiveX F F ˈ F F ก F ก F F F F *.ocx F F ก ก F F ก F F Fก F ก ก Project/Components ( ก Fก F ก Components ก F) 2.6.9 F (Form) F FF ˈ F ก F ก F F FF ก ก ก ˈ F FF ˈ (Container) ก VB F F ก F F Project Explorer ก F F F 1 ก F ก F F 1 F ( ก F F F F ก ก .dll ˈ F F (In-Process) VB ก F F F F ก F Fก F F ก
  • 46. 32 2-31 F F VBIDE 2.6.10 Project Explorer (Project Explorer Window) F F Project Explorer F F ก ก F ก VB 6.0 ก Project ก F ˈ ก F F( ก .vbg) VB ก F F F F ก F ก ก .vbp F F Project ก F ก F ก F F F F (Tree-View) F ˈ F F F ก ก F F ก F F F F ก F ก ˈ F F 2 ก ก ก ˈ F F ก ก ก F F F ก F F ก ก ก F F F F ก F ก F ก ˈ F ก ก F 2-32 2-32 Project Explorer ก F ก F F Multiple ก F Explorer ก F F F ก F ก F
  • 47. 33 2.6.11 ก F F (Initial) programming F F F F F (Properties Window) F F Fก (Active) F (Focus) F ก F ก F F ก F F ก F F F VB F F F ˈ F ก F FF ˈ F ก F F F F F F F F ก F ก F F ก F F F F 2-33 F F F F FF ˈ VB Fก VB F F F F F F F F Form Layout F F Form Layout F ก ก F F ก F ก drag F F F ก ( F F F F F F F F F F ก F VB F F F ก F ก F ก (Default) F F F F F ˈ Alphabetic 2.6.12 F F F F ˈ ก F F F ก 4 ) F ก F F ก F F
  • 48. 34 2-34 2.6.13 F F ˈ ก F F ก ก F F F F ก F F Form Layout (Immediate Window) F ก F ก ก ˈ F F F ก ก View/Immediate Window F ก 2-35 2.6.14 F F F Immediate VBIDE F 2.6.14.1 ˈ F VBIDE F F2 MDI (Multiple Document Interface) F ก VB 2-36 F F ˈ
  • 49. 35 2- 36 F VBIDE MDI 2.6.14.2 SDI (Single Document Interface) F F ก ˈ F ก F Fก MDI F F ก 2-37 (Available online at http://kampol.htc.ac.th/web1/ subject/programming2/ sheet/vb6/vbch01.htm,2008) 2- 37 2.7 ก ก F ก ก F VBIDE SDI F (2548 : ) F ก ก ˈ ก F F กก F ʽ F F F F F ก F ก ก ˈ F ก F Fก F F F ก กF ก F F
  • 50. 36 F F ก F ก F ก F ก F ก ˆˉ F ก F F ก F F F F F Web Server ก F ก ก F Fก F F ˈ ก ก ก ก F F (2548 : ) F ก ก ก F F F กก ก F F ก F F F F F ʽˊ F F ก ก F Fก Fก F ก ก ก F F F F F F F ก (2551 : ) F ก ก ก กก ก F F F F ก ก ก F F F F F F F F ก F F F F ก ก F F F F ˂ F ʾ F F F F ก F F ก ก IP Address F F LAN F F F กก F Fก F
  • 51. 3 ก ก ก F 3.1 ก 3.2 ก 3.2.1 3.2.2 3.2.3 3.3 ก 3.4 ก 3.5 3.1 ก ก ก F ก ก WebCam ˈ ก F ʽ F F ก ˈ 5 F F ก (Flow Chart) Context Diagram Data Flow Diagram ก ก ก F F ก ก F F F ก ก F ก WebCam F ก ก ก ˈ 2 F ก ʽ ก ก F F (Admin) F F ก 3.1.1 ก ก ก Webcam F ก ก F F ก F F ก ก F ʽ F ก F F Fก F F F F ก ก WebCam ˈ ก F ʽ F F 3.1.1.1 ก (Dynamic DNS) ˈ F F F F ˈ ก F ก (User) ˈ ก F ก ก ก 2 ก ʽ F F ก F ʽ F F F F ก
  • 52. 38 ก Fก F F F F ก ก F กF F ก ก F 203.156.24.52 ก F F 3.1.1.2 DNS ( Domain Name Service ) F F www.company.com F กF F F (DNS Server) 3.1.2 ก ก F F (Admin) F F F (Admin) F F กF ก ก ก กก F F F F ก (User) F F F F F F กF F F F 3.2 ก 3.2.1 ก (Flow Chart) 3.2.1.1 (Flow Chart) F ก F ก F ˈ F ก F ก ก กF F ก F F F F F กF ʽ Real Time ก On Demand F F ก ก (User) F ก F F ก ก F ก F Real time F F F F F F Sever Fก ก ก ก ก ก กก F
  • 53. 39 F ˆ (Real Time) ก F F (On Demand) ก ก ก 3-1 3.2.1.2 Password ก F Flow Chart (Flow Chart) F F F F ก F F F ก F ก ก F ก ก ก F F F F F F ก F F ก กก F ʽ ˆ F Username F ก F ก
  • 54. 40 F Username Password Fก F ก F กก F (Real time) F (On Demand) F F ก ˁ Stop ก 3-2 ก F F F F
  • 55. 41 3.2.2 Context Diagram 3-3 Context Diagram F F ˈ ก F FF F ก F ก F 3.1 ก F2 F F User ก Admin Fก F
  • 56. session ก F 6 ก ก Admin User session F ก F F F F Username Password F F ˆ F F F ˆ 3 2 F F ก F F ก F F Username Password F F 3-4 Data Flow Diagram F F 1 F F F ˆ F F ก ก User Admin ก F กF กF F F F ก กF F F F 4 ก 5 กF ก F ก F 42
  • 57. 43 3.2.3 Data Flow Diagram ก ก F Process F Process 1 ก F F F F Admin F F ก) F F F ) ก F ก ก ก Username Password F ˆ F F F 3-5 Data Flow Diagram Level 1 Process 1(ก Process 2 ก F ˆ F Admin 3-4 F ก F 3-6 Data Flow Diagram Level 1 Process 2 (ก F F F F ) F F F F ˆ ) ก
  • 58. 44 Process 3 ก F F F ก ก) ก ) F F User ก Admin F User F ก F F F Process 4 ก กF / Admin ก) ก F ) F F F ก Admin F F F F F ก กF ˈ ˁ ก ก F ก ก ) กF 4. F F F F ˁ F ก Admin F ก F ˈ F 4.1 ก F F ก F 3-7 Data Flow Diagram Level 1 Process 3 (ก F ก ก F 3-8 Data Flow Diagram Level 1 Process 4 (ก F F ก ก กF / กF F ก ก F )
  • 59. 45 Process 5 ก ก F ก F ก) ก ก ) ก F ก F ก ก F Admin ก 3-9 Data Flow Diagram Level 1 Process 5 (ก 3.3 ก ก ก ก ก F ก F ก F) ก F ก F ก User F F (Attribute) 3-1 ก ʽ F 1 2 3 4 5 ˈ ˁ ID Name Surename Usermame Password text varchar varchar varchar varchar 10 20 10 50 50 ก ก ก F F F ก F PK ก
  • 61. 47 3.4.3 F Login F F ก F 3-12 3.4.4 F F Login F F ˆ 3-13 F ˆ (Real time)
  • 63. 49 3.5 ก ก 3.5.1 ก 3.5.1.1 ก ก Fก F WebCam ก ก ก Fก F WebCam ก F ก ก 3-16 ก 3.5.1.2 ก ก 3-17 ก F F ก ก User F ก F ก F F ก Visual Basic ก ก Visual Basic ก User
  • 64. 50 3.5.1.3 ก F Login F ก Macromedia Dreamweaver 3-18 ก 3.5.1.4 ก F 3-19 ก FF F F Login F ก Macromedia Dreamweaver FF
  • 65. 51 3.5.1.4 ก F F ˆ 3-20 ก F F ก Macromedia Dreamweaver F F ˆ ก Visual Basic ก F ก F ก ก ก F กF ก ก 3.5.2.1 ก ก ก F 3.5.2.2 ก ˁ Start Broadcast F Internet F 3.5.2.3 ก ˁ Start Record F F Internet F 3.5.2.4 ก F F ก ก WebCam A port : 1252 WebCam B 3.5.2.5 F Device กก F ก Capture Audio ก ก F 3.5.2.6 F Video Limit ก F F ก 60 20100310-093026 F F กก F ก ก ก . 3.5.2 Fก F WebCam ก ʽ F กก F WebCam ก F ก F ก ˈ ก F ก ก F ก ก F F F F FF F F port : 1251 2ก F F ก F F F F 60 ˈ 20100310-103026 ˈ F F FF F F F
  • 66. 52 F 3-21 3.5.2.7 ก Folder F ก กก ˈ F ก ก F ก ก ก .wmv ก F F 3-22 ก ก ก (Server) ก ˁ Browse F Video Path : ก c:AppservwwwWebCamvideo Folder ก F F
  • 67. 53 F 3-23 ก F F 3.5.2.8 ก ก กF ก F User ก) FF User F Fก ˁ ก ) F ก กF F ก Fก ก F Fก ˁ ก ) F ก F ก ก F ก ก F ก ก 3-24 F ก User ก F F ก F Use F F ก ˁ
  • 68. 54 3.5.2.9 ก) ก F F F ก ก Username/Password F F ก ˁ Login ก F F F 3-25 ) F ก ก F F F F F Fก 3-26 F ˁ F ก F F FF ˆ (Real Time) ˆ ก
  • 69. 55 ) ʾ ก F A ʾ 2010 F F F 06 06 F F VDO F ก F F ก F F F ก ก F B F A-20100606-143050.wmv F F F F Fก ˁ F ก Windows media player ʽ 3-28 F F2ก F A 14:30:50 . 3-27 ) ˈ .wmv F F ก F F ก
  • 71. 4 ก ก ก Fก F WebCam ˈ ก F ʽ F F 2 ก ก (Server) F F (Client) F Server F CPU Pentium 4 3.0 Ghz. Ram 2 GB. F F Client F CPU Pentium 4 2.8 Ghz. Ram 1 GB. F F 4 MB. F F ก F 4.1 ก ˁ ก F 4.2 F ก 4.1 ก 4.1.1 F F ก ˁ ก ก F Device กก F 4-1 F Device F F ก ก F USB
  • 72. 58 4.1.1.2 F 4.1.1.3 ก ก F F F F ก 10 ก ก F F F ก F F ก 60 MB. Video Path ก Folder F ก ก F F Video Limit F ( ) F ก F ก F ก ก ก F F ˈ F F ก 10 F Fก F Fก F 60 F F 60 F 1 F 1 MB. 4-2 Video Path Video Limit F F
  • 73. 59 F ก 4.1.1.4 F ก User F กF ก F F F ก ก F F 4-3 F ก ˁ User Account ก F ก F F F User F F Fก F F กF F F ก User 4.1.2 ˆˉ Client 4.1.2.1 F F F F F F F URL ˆˉ Server http://192.168.0.224/webcam/login 4-4 F Login F F F F http://192.168.0.224/webcam/login
  • 74. 60 4.1.2.2 /Password F ก F F Login F ก F F F F 4-5 4.1.2.3 F F ก F F F F F Username F F Username (ee) F ee F 4-6 F ก F F F F F
  • 75. 61 F 4.1.2.4 F F 4-7 4-8 F F Username / Password Fก F F F ก ก F F F F F Fก F F ˆˉ Client ก
  • 76. 62 4.2 F 4.2.1 5 F ก ก F ก F กก F F 10x10 4-9 4.2.2 F F 1ก F ก Webcam ก F ก F F 15:49 . F ก F F F 4-10 F F ก กก F Webcam ก 4-10 F F ก 16:49 . ก 1 . Video Limit ˈ 60 ก F กF ʽ F ก F 58.3 MB 60 ก
  • 77. 63 4-11 4.2.3 F ก ˈ ก 3 F ก ก B Fก F ก F A FF ก ก Fก F F ก F A (3 F F 5 F ก ก ˈ ) ก B (5 F ก 1 F . F ก F F F ก ) F ก F A ก F B F F
  • 78. 64 4-12 4.2.3 ก F ก F ก ก ก 1-2 F F 4-1 F กก F A F 3x7 ก F ก กก F 2ก F 4-2 ก F ก F A B 4-1 F ก 1234 9x20 . ก F Windows Server 2003 R2 F F ก F F F ก กF F3 F F ก 4-2 ก F ก F B ก 1234 9x20 . ก F Windows Server 2003 R2 F ก F ก F ก ก F ก F A 1-5 FF ก F ก ก ก Fก F F F Fก F ก ก ก F F F F ก 3x7
  • 79. 65 4-1 F ก ก F F ก F A (3 F F กF ก ก ( 1234 9x20 . 1 1234 9x20 . 2 1234 9x20 . 3 1234 9x20 . 4 1234 9x20 . 5 ) ก ก ) F
  • 80. 66 4-1 ( F ) F F กF ก 18x23 . 18x23 . 18x23 . 18x23 . 18x23 . ก ( 1 2 3 4 5 ) ก
  • 81. 67 4-2 F ก ก F F ก F B (5 F F กF ก ก ( 1234 9x20 . 1 1234 9x20 . 2 1234 9x20 . 3 1234 9x20 . 4 1234 9x20 . 5 ) ก ก ) F
  • 82. 68 4-2 ( F ) F F กF ก 18x23 . 18x23 . 18x23 . 18x23 . 18x23 . ก ( 1 2 3 4 5 ) ก
  • 83. 5 ก กก F F F ก F F 5.1 F ก Fก F Webcam ˈ ก F ʽ F Fก F ʽ ก ก ก ก ก F ก ก F Webcam F Username Password ก F F F กF F F ก Fก ก F ก ก F ก 5.1.1 ก Fก F Webcam F F ก ˈ ก F ʽ F F 5.1.2 5.1.3 5.2 F 5.2.1 F F ก ก 5.2.2 ก 60 MB. 5.2.3 ก F F F ก ก ก F F ก ก F Webcam F ก F F F ก ก Fก F F F ก ก F Fก F Web Browser Web Browser F ก ก F F ก F 1ก F 1 F ก F F F Internet Explorer 8 F
  • 84. 70 ก ก F ก F ก กF F F F . F . ก F ก ก F F . ก ก F ก F , 2548. F. Advance Visual Basic ก F F F. ก , 2551. F F ก ก .ก : ก ( ), 2551. ก : F ก F F . Available online at http://school.obec.go.th/mrPaisan/e-learning /information/content/internet1.htm[2008,June 8]. Fก ก ก Visual Basic. Avaliable online at http://kampol.htc.ac.th/web1/ subject/programming2/sheet/vb6/vbch01.htm[2008,May 15]. F ʽ (CCTV). Available online at http://www.matcom.co.th/ contents.php?id=300.htm, [2008,May 29]. F F (Server). Available online at http://www.vcharkarn.com/vblog/41000 [2009,March 9]. (Web camera). Available online at http://www.tteen.net/view.php[2008,June 8]. DNS (Domain Name Service). Available online at http://www.itdestination.com/articles /dynamicdns[2008, June 20].
  • 85.
  • 88. 74 Enter root password : 1234 ( ( Server Name F ก ) F ก )
  • 89. 75
  • 90. 76 ( 2. Copy 3. 4. F ก F F F F WWW. F Vedio ก ก Appserv ) F C:/Appserv c:Appservwwwwebcam F Camserver.exe F ก
  • 93. 79 F ก ก 'Object '1 VideoCapX1 ˈ Object ก ( ก ) F F ก ก F F Device ก F F F Version 6.2.0.258 '2 Winsock1 ˈ Object F ก F F F ก IP Dim cFileVideo As Dim cPort1, cPort2 As String Dim No1, No2 As Integer Dim ClickBc1, ClickBc2 As Boolean Dim fs As Object ' Private Sub Form_Load() cPort1 = "1251" String ' ก F Video ' ก Port ก F ' ก ก ' ก ก ˁ Broadcast Object F ก Object ก F ก Text ' ก 'ก F Port F F
  • 94. 80 cPort2 = "1252" Me.Caption = "Cam Server IP " & Winsock1.LocalIP ' Title F IP Frame1.Caption = "WebCam A : " & cPort1 Frame2.Caption = "WebCam B : " & cPort2 ' Device Webcam F ˈ ก Com For f = 0 To VideoCapX1.GetVideoDeviceCount - 1 bobox Combo1.AddItem VideoCapX1.GetVideoDeviceName(f) Combo2.AddItem VideoCapX1.GetVideoDeviceName(f) Next f If Combo1.ListCount > 0 Then Combo1.ListIndex = 0 'ก F ก Combobox ก Call Combo1_Click ' ก ก F ก F Com bo1_Click End If If Combo2.ListCount > 1 Then Combo2.ListIndex = 1 'ก F ก Combobox ก ' ก ก F ก F Com Call Combo2_Click bo1_Click Else LockScreen2 (False) End If No1 = 0: No2 = 0 ' F No1,No2 F F ˈ 0 On Error GoTo OpErr ' ก Error F Error ก F OpErr F F F Error Set fs = CreateObject("Scripting.FileSystemObject") ' ก F Object ก F F Set fTxt = fs.OpenTextFile(App.Path & "VideoPath.cfg", 1, 0) ' ʽ F F F DefaultPath.cfg txtPath.Text = fTxt.ReadLine() 'F fTxt.Close ' ʽ F OpErr:
  • 95. 81 Set fWr = fs.CreateTextFile(App.Path & "VideoPath.cfg", True) ' ʽ fWr.WriteLine ("c:") ' fWr.Close ʽ F End Sub F ก "c:" Private Sub Form_Unload(Cancel As Integer) ' ก Set fWr = fs.CreateTextFile(App.Path & "VideoPath.cfg", True) ' ʽ F ก fWr.WriteLine (txtPath.Text) ' F txtPath.Text fWr.Close ' ʽ F End Sub F ก ʽ ' ก F ก Device Combobox Private Sub Combo1_Click() If VideoCapX1.Connected Then VideoCapX1.Connected = False ' F ก F ก Webcam F Fก F ก ก VideoCapX1.CaptureAudio = Check1.Value ' ก ก ก VideoCapX1.VideoDeviceIndex = Combo1.ListIndex index item Combobox ก VideoCapX1.UseVideoFilter = vcxBoth VideoCapX1.PreviewAudio = True VideoCapX1.Connected = True VideoCapX1.SetVideoFormat 320, 240 'VideoCapX1.SetVideoFormat 640, 480 '7200 x 9600 VideoCapX1.Preview = True 'ก ' ก ' ' ก 'ก 'ก ' Deivce Webcam ˈ Video F F ก Webcam กF x กF x F
  • 96. 82 VideoCapX1.SetTextOverlay 0, "TIME", 0, 0, "Arial", 18, 255, -1 ' F End Sub Private Sub cmdBroadcast1_Click() ' ก F ก ˁ Start Broadcast If LCase(cmdBroadcast1.Caption) = "start broadcast" Then ' Start.. ClickBc1 = True ' F ClickBc ˈ true ( ) VideoCapX1.WMAttributes = "My webcam A|Author is me|Copyright to me|rating is 5|this is description" VideoCapX1.StartBroadcast cPort1, 5 cmdBroadcast1.Caption = "Stop Broadcast" ' Caption ˁ ˈ Stop.. ' ก ก F Object Call LockScreen1(False) F F F cmdBroadcast1.Enabled = True ' ʽ F F ˁ Stop Broadcast No1 = 1 Else ' F ClickBc ˈ false ( ) ClickBc1 = False VideoCapX1.StopBroadcast cmdBroadcast1.Caption = "Start Broadcast" ' Caption ˁ ˈ Start.. Call LockScreen1(True) ' ก ก F Object F F F No1 = 0 End If End Sub Private Sub cmdRecord1_Click() If LCase(cmdRecord1.Caption) = "start record" Then VideoCapX1.CaptureRate = Val(txtVideoLimit.Text) ' ' ก F ก ˁ Start Record ก ก
  • 97. 83 VideoCapX1.StartCapture cmdRecord1.Caption = "Stop Record" Call LockScreen1(False) F F F cmdRecord1.Enabled = True No1 = 1 Else VideoCapX1.StopCapture cmdRecord1.Caption = "Start Record" Call LockScreen1(True) F F F No1 = 0 End If End Sub Private Sub cmdZZ1_Click(Index As Integer) If Index = 0 Then If cmdZZ1(0).Caption = "zZ" Then VideoCapX1.Left = 15 VideoCapX1.Height = 7200 VideoCapX1.Width = 9600 VideoCapX1.SetVideoFormat 640, 480 cmdZZ1(0).Caption = "Zz" Else VideoCapX1.Left = 15 VideoCapX1.Height = 3600 VideoCapX1.Width = 4800 VideoCapX1.SetVideoFormat 320, 240 cmdZZ1(0).Caption = "zZ" ' F ก ' Caption ' ก ก F ' ʽ F ˁ F ˈ Stop.. Object ' Caption ' ก ก F ˁ ˁ Stop Record ˈ Start.. Object 'ก กF x 'ก กF x
  • 98. 84 End If cmdZZ2(0).Visible = cmdZZ1(0).Caption = "zZ" VideoCapX2.Visible = cmdZZ2(0).Visible Frame1.Visible = cmdZZ2(0).Visible Frame2.Visible = cmdZZ2(0).Visible txtPath.Visible = cmdZZ2(0).Visible cmdSelectPath.Visible = cmdZZ2(0).Visible txtVideoLimit.Visible = cmdZZ2(0).Visible cmdUserAcount.Visible = cmdZZ2(0).Visible cmdZZ1(1).Visible = cmdZZ2(0).Visible cmdZZ2(1).Visible = cmdZZ2(0).Visible cmdZZ1(0).Top = VideoCapX1.Height - cmdZZ1(0).Height cmdZZ1(0).Left = (VideoCapX1.Left + VideoCapX1.Width) - cmdZZ1(0).Width End If If Index = 1 Then If cmdZZ1(1).Caption = "oo" Then 'ก กF x VideoCapX1.SetVideoFormat 640, 480 cmdZZ1(1).Caption = ".." cmdZZ1(0).Enabled = False Else VideoCapX1.SetVideoFormat 320, 240 'ก กF x cmdZZ1(1).Caption = "oo" cmdZZ1(0).Enabled = True End If End If End Sub Private Sub Combo2_Click() ' ก F ก Device Combobox
  • 99. 85 If VideoCapX2.Connected Then VideoCapX2.Connected = False ' F ก Fก F ก ก VideoCapX2.CaptureAudio = Check2.Value ' ก Deivce VideoCapX2.VideoDeviceIndex = Combo2.ListIndex 'ก index item Combobox ก VideoCapX2.UseVideoFilter = vcxBoth ' ก ' F VideoCapX2.PreviewAudio = True VideoCapX2.Connected = True ' ก Fก VideoCapX2.SetVideoFormat 320, 240 'ก 'VideoCapX2.SetVideoFormat 640, 480 'ก '7200 x 9600 VideoCapX2.Preview = True ' VideoCapX2.SetTextOverlay 0, "TIME", 0, 0, "Arial", 18, 255, -1 ' F End Sub F ก Webcam F ก ก Webcam ˈ Video Webcam กF x กF x F Private Sub cmdBroadcast2_Click() ' ก F ก ˁ Start Broadcast If LCase(cmdBroadcast2.Caption) = "start broadcast" Then ' Start.. ' F ClickBc ˈ true ( ) ClickBc2 = True VideoCapX2.WMAttributes = "My webcam B|Author is me|Copyright to me|rating is 5|this is description" VideoCapX2.StartBroadcast cPort2, 5 cmdBroadcast2.Caption = "Stop Broadcast" ' Caption ˁ ˈ Stop.. Call LockScreen2(False) ' ก ก F Object F F F cmdBroadcast2.Enabled = True ' ʽ F F ˁ Stop Broadcast No2 = 1 Else ' F ClickBc ˈ false ( ) ClickBc2 = False
  • 100. 86 VideoCapX2.StopBroadcast cmdBroadcast2.Caption = "Start Broadcast" Call LockScreen2(True) F F F No2 = 0 End If End Sub Private Sub cmdRecord2_Click() If LCase(cmdRecord2.Caption) = "start record" Then VideoCapX2.CaptureRate = Val(txtVideoLimit.Text) VideoCapX2.StartCapture cmdRecord2.Caption = "Stop Record" Call LockScreen2(False) F F F cmdRecord2.Enabled = True No2 = 1 Else VideoCapX2.StopCapture cmdRecord2.Caption = "Start Record" Call LockScreen2(True) F F F No1 = 0 End If End Sub Private Sub cmdZZ2_Click(Index As Integer) If Index = 0 Then ' Caption ' ก ก F ' ก ˁ ˈ Start.. Object F ก ˁ Start Record ' ก ก ' F ก ' Caption ˁ ' ก ก F ' ʽ F F ' Caption ' ก ก F ˈ Stop.. Object ˁ ˁ Stop Record ˈ Start.. Object
  • 101. 87 If cmdZZ2(0).Caption = "zZ" Then VideoCapX2.Left = 15 VideoCapX2.Height = 7200 VideoCapX2.Width = 9600 VideoCapX2.SetVideoFormat 640, 480 'ก กF x cmdZZ2(0).Caption = "Zz" Else VideoCapX2.Left = 4830 VideoCapX2.Height = 3600 VideoCapX2.Width = 4800 VideoCapX2.SetVideoFormat 320, 240 'ก กF x cmdZZ2(0).Caption = "zZ" End If cmdZZ1(0).Visible = cmdZZ2(0).Caption = "zZ" VideoCapX1.Visible = cmdZZ1(0).Visible Frame1.Visible = cmdZZ1(0).Visible Frame2.Visible = cmdZZ1(0).Visible txtPath.Visible = cmdZZ1(0).Visible cmdSelectPath.Visible = cmdZZ1(0).Visible txtVideoLimit.Visible = cmdZZ1(0).Visible cmdUserAcount.Visible = cmdZZ1(0).Visible cmdZZ1(1).Visible = cmdZZ1(0).Visible cmdZZ2(1).Visible = cmdZZ1(0).Visible cmdZZ2(0).Top = VideoCapX2.Height - cmdZZ2(0).Height cmdZZ2(0).Left = (VideoCapX2.Left + VideoCapX2.Width) - cmdZZ2(0).Width End If If Index = 1 Then If cmdZZ2(1).Caption = "oo" Then 'ก กF x VideoCapX2.SetVideoFormat 640, 480 cmdZZ2(1).Caption = ".."
  • 102. 88 cmdZZ2(0).Enabled = False Else VideoCapX2.SetVideoFormat 320, 240 cmdZZ2(1).Caption = "oo" cmdZZ2(0).Enabled = True End If End If End Sub Private Sub cmdUserAcount_Click() Form3.Show 1 End Sub 'ก กF x ' ˁ User Account Private Sub cmdSelectPath_Click() ' ˁ ... ก Floder ก SystemPath = txtPath.Text 'ก F F TextBox F Form2.Show 1 ' ʽ F ก Floder txtPath.Text = SystemPath ' F F F TextBox No1 = 0: No2 = 0 End Sub Private Sub Timer1_Timer() ' ก F ก cFileVideo = Format(Now, "yyyyMMdd-hhmmss") & ".wmv" ' ก F ก F ˈ .wmv ( windows media player) If No1 = 0 Or (No1 >= Val(txtVideoLimit.Text) * 60) Then ' cFileVideoA = "A-" & cFileVideo VideoCapX1.CapFilename = txtPath.Text & cFileVideoA 'ก F ก F Folder F
  • 103. 89 txtVideoFile1.Text = cFileVideoA If (No1 >= Val(txtVideoLimit.Text) * 60) Then ' No1 = 1 ' ' If ClickBc1 Then VideoCapX1.StopBroadcast ' VideoCapX1.StartBroadcast cPort1, 5 ' End If End If End If If No2 = 0 Or (No2 >= Val(txtVideoLimit.Text) * 60) Then cFileVideoB = "B-" & cFileVideo VideoCapX2.CapFilename = txtPath.Text & cFileVideoB F txtVideoFile2.Text = cFileVideoB If (No2 >= Val(txtVideoLimit.Text) * 60) Then ' No2 = 1 ' F 1 F If ClickBc2 Then ' VideoCapX2.StopBroadcast ' VideoCapX2.StartBroadcast cPort2, 5 ' End If End If End If No1 = No1 + 1 ' No2 = No2 + 1 End Sub Private Sub txtVideoLimit_KeyPress(KeyAscii As Integer) ' ' F F ˁ Backspace If KeyAscii = 8 Then Exit Sub ' ' F F F ก F 1 F F ก ก ˁ Broadcast F ก Broadcast Broadcast ' 'ก F ' ก F F F Folder F ก F ก ก ˁ Broadcast F ก Broadcast Broadcast +1 ก F ก F F ˁ Backspace TextBox
  • 104. 90 If KeyAscii < 48 Then KeyAscii = 0 If KeyAscii > 57 Then KeyAscii = 0 End Sub ' ' F ˁ F ˁ F กF 0 F กF 9 Private Sub LockScreen1(sw As Boolean) sw (true,false) ( , ) Combo1.Enabled = sw Check1.Enabled = sw txtREC1.Visible = Not sw txtVideoFile1.Visible = Not sw cmdBroadcast1.Enabled = sw cmdRecord1.Enabled = sw cmdZZ1(0).Enabled = sw cmdZZ1(1).Enabled = sw Call LockScreenFile End Sub ' ก F Object F F F Private Sub LockScreen2(sw As Boolean) sw (true,false) ( , ) Combo2.Enabled = sw Check2.Enabled = sw txtREC2.Visible = Not sw txtVideoFile2.Visible = Not sw cmdBroadcast2.Enabled = sw cmdRecord2.Enabled = sw cmdZZ2(0).Enabled = sw cmdZZ2(1).Enabled = sw Call LockScreenFile ' ก F Object F F F
  • 105. 91 End Sub Private Sub LockScreenFile() ' txtPath.Enabled = Check1.Enabled And Check2.Enabled cmdSelectPath.Enabled = txtPath.Enabled txtVideoLimit.Enabled = txtPath.Enabled End Sub F ก F F ก ก F Private Sub Command1_Click() SystemPath = Replace(Dir1.List(Dir1.ListIndex) & "", "", "") Unload Me End Sub Private Sub Dir1_Change() F F F F
  • 106. 92 End Sub Private Sub Form_Load() On Error GoTo Err Dir1.Path = SystemPath Exit Sub Err: Dir1.Path = "C:" End Sub F ก User Public nConnect As ADODB.Connection Dim NewMode As Boolean ' Private Sub Form_Load() NewMode = True DataPath = App.Path & "DataBase.mdb" On Error GoTo ChkErr Set fs = CreateObject("Scripting.FileSystemObject") F F / กF ' ก F Object ก CardAssign F F
  • 107. 93 Set fTxt = fs.OpenTextFile(App.Path & "DBPath.cfg", 1, 0) ' ʽ F DefaultPath.cfg DataPath = fTxt.ReadLine() ' F ʽ F fTxt.Close ChkErr: If Err.Number = -2147467259 Or Err.Number = 53 Then CommonDialog1.CancelError = True CommonDialog1.Filter = "Microsoft Office Access (*.mdb)|*.mdb" CommonDialog1.Flags = OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST CommonDialog1.ShowOpen If CommonDialog1.FileName = "" Then Exit Sub DataPath = CommonDialog1.FileName End If ' F F Set nConnect = New ADODB.Connection strConn = "Provider = Microsoft.Jet.OleDb.4.0;Data Source =" & DataPath nConnect.ConnectionString = strConn nConnect.Open Set fWr = fs.CreateTextFile(App.Path & "DBPath.cfg", True) ' ʽ F ก ' fWr.WriteLine (DataPath) fWr.Close ' ʽ F Call ShowDataList ' F End Sub F Private Sub ShowDataList() ' F Call HeadGridList ' F F Set recData = New ADODB.Recordset cSQL = "SELECT ID,FName,LName,Login,Password FROM [Register] Order By ID" recData.Open cSQL, nConnect, 3, 1 F "c:" F F F
  • 108. 94 If recData.RecordCount > 0 Then Do While Not recData.EOF mfGrid1.AddItem recData("ID") & "" & vbTab & _ recData("FName") & "" & vbTab & _ recData("LName") & vbTab & _ recData("Login") & vbTab & _ recData("Password") recData.MoveNext Loop End If End Sub Private Sub HeadGridList() mfGrid1.Cols = 5: mfGrid1.Rows = 1 mfGrid1.ColWidth(0) = 1000: mfGrid1.ColAlignment(0) = 5 mfGrid1.ColWidth(1) = 2000 mfGrid1.ColWidth(2) = 2000 mfGrid1.ColWidth(3) = 2000 mfGrid1.ColWidth(4) = 0 mfGrid1.Row = 0 mfGrid1.Col = 0: mfGrid1.Text = " " mfGrid1.Col = 1: mfGrid1.Text = " " mfGrid1.Col = 2: mfGrid1.Text = " ก" mfGrid1.Col = 3: mfGrid1.Text = " F F mfGrid1.Col = 4: mfGrid1.Text = " F " End Sub Private Sub mfGrid1_Click() "
  • 109. 95 If mfGrid1.Row > 0 Then NewMode = False mfGrid1.Col = 0: Text0.Text = mfGrid1.Text mfGrid1.Col = 1: Text1.Text = mfGrid1.Text mfGrid1.Col = 2: Text2.Text = mfGrid1.Text mfGrid1.Col = 3: Text3.Text = mfGrid1.Text mfGrid1.Col = 4: Text4.Text = mfGrid1.Text cmdTool1(1).Enabled = True End If End Sub Private Sub cmdTool1_Click(Index As Integer) cCardTagID = Trim(Text1.Text) Select Case Index Case 0 If Trim(Text1.Text) = "" Then Text1.SetFocus Exit Sub End If If Trim(Text3.Text) = "" Then Text3.SetFocus Exit Sub End If If Trim(Text4.Text) = "" Then Text4.SetFocus Exit Sub End If If NewMode Then cID = "01" ' ˁ ก/ 'ก ˁ ' F F ก F F Esle กF F
  • 110. 96 Set recData = New ADODB.Recordset cSQL = "SELECT MAX(ID) As mID FROM [Register]" recData.Open cSQL, nConnect, 3, 1 If recData.RecordCount > 0 Then cID = Format(Val(recData("mID") & "") + 1, "00") End If cSQL = "INSERT INTO [Register](ID,FName,LName,[Login],[Password]) " & _ "VALUES('" & cID & "','" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "') " Else cSQL = "UPDATE [Register] SET FName='" & Text1.Text & "',LName='" & Text2.Text & "',[Login]='" & Text3.Text & "',[Pass word]='" & Text4.Text & "' " & _ "WHERE ID='" & Text0.Text & "' " End If Case 1 'ก ˁ If MsgBox (" F ก F ก F", vbYesNo + vbQuestion, " F ") = vbYes Then cSQL = "DELETE FROM [Register] WHERE ID='" & Text0.Text & "'" Else Exit Sub End If End Select nConnect.Execute cSQL Call ShowDataList ' F ' F F F NewMode = True Text0.Text = "Auto" Text1.Text = "" Form3 - 3 Text2.Text = ""
  • 111. 97 Text3.Text = "" Text4.Text = "" Text1.SetFocus End Sub