You are on page 1of 102

.....................................................................................................................

5
...................................................................................................................7
..................................................................................8
2.
.............................................................................................16
2.1 .................................................................16
2.1.1 CGI...............................................................16
2.1.2 .............................................17
2.1.3 ASP.............................................18
2.1.4 Perl..............................................18
2.1.5 C# dotNet...........................................................................19
2.1.6 Delphi.........................................................................................................19
2.2 .....................................................................................21
2.2.1 MySQL.................................................................................21
2.2.2 MS SQL................................................................................21
2.2.3 ORACLE..............................................................................22
2.3. .................................22
3. ........................................23
3.1 .....................................................23
3.2 ..........................................................23
3.3 SQL..........................25
3.4 ..............................................................26
3.5 ..............................................................38
4. .............................................44
3.1 ..............................................44
4.2 ...........................................................................................46
4.3 C...........................................................................................58
5. ....................................................................66
5.1 MySQL.........................................................................66
5.2 MySQL.........................................................................67
5.3 ODBC.........................................................................68
5.4 .................................................................71
6. - ...................................73
6.1 .......................................................................................................73
6.2 ...........................................73
6.3 ............................................................76
6.4 ...............................................79
6.5 .............................................79
6.6 ................................................................81
6.7 .
.............................................................................................................................85

7. ............................................88
7.1 ............88
7.2 .................89
7.3 ..............................91
7.4 ....................................................................93
7.5 ..............................................95
7.6 , , ......96
7.7 ..................................................................................98
7.8 ............................................................................100
..........................................102
1.......................................................................................................103


"

"

104 , 23
, 33 , 1 ;
1.

Microsoft Word 2000.
Visio 2003 graph.exe (314 ).
:
- ClServerSruct.vsd (243 )
(1 1);
- DataStruct.vsd (44 ) - (1 1);
- DBStruct.vsd (73 ) - (1 1);
- EconPart.vsd (43 ) - - (1
1);
- RPP.vsd (197 ) - (1 1);
-RPS.vsd (175 ) - (1 1);
- AlgStud.vsd (182 ) - (1
1);
- All.vsd (186 ) - (1
1).
,
source.exe (1 012 ).
:
, , ,
, DELPHI, KYLIX, SQL, ADO, ODBC.


,
.
.

,
. ,
, ,
. .

,

.
. ,
.
, .

,
.
, .
, ,
.


..., .

___________

___________ . .

_______________ _____ .

_______________ _____ .



:
:


8
1 2003 .
:

______________
"___"____________ _____ .
2003

9
2.011.215.
1.
1.1. -
.
1.2. .______________
1.3. - 230282 ..
1.4. ,
: 1718 "22"
2003.
1.5. - " 1 " 2003 .
- " 1 " 2003 .
1.6.
:
)
220100 , ,
.
)
220100/. ., , : , 1994, - 34..
2.
2.1.
.
2.2.

,
,
, ,
.
3.


. ,
.
,
, .
, ,

.
, ,
. ,

.

10
2.011.215.
4.
4.1.
4.1.1. .

:
( );
( );
( ).
,

Windows, Linux/Unix.

,
.
WEB- Apache+PHP.
,
, :
1. .
,
.

,

.
.

.
,
,
. ,
, .
.
,

(
,

, )
, .
.
( ,
).


.

11
2.011.215.
.
1 " "

/
1


,
,
, ,
.
. N1
, ,
. N2 , , .
N3 , , . N4
, .
2 "
"
1 .

N1
N2
N3
N4


ASM .
2. C.
,
.

.

.
.
.

.

ASM .

12
2.011.215.
.

4.1.2.

.

:
) Windows/Linux
;
)
Windows/Linux .
4.1.3. .


.

.
4.1.4. .

, ,

4.1.5. .

4.1.4.
4.1.6. , ,
.

+15 +25
40% - 60%.
4.1.7 .

MS Windows Linux.

.

4.1.8. .


.
4.2. , .

13
2.011.215.
) ;
) .
4.3. .
4.3.1 .
)
Microsoft Windows 9x/Me/NT/2000/XP - Linux.
) Borland Delphi 6.0
Enterprise Borland Kilyx 2.0 Enterprise;
4.3.2 .

( ) Celeron 333 , 64,
1 .
4.3.3 .

.
4.3.4. .

.
4.3.5. .

5.

. 1.6.
. ,
,
. 1.6.
6.

(), .

7.

4.1.1
, .
.

14
2.011.215.
8.

. 1.6.
9.
1. 15,001 - 88 .
2.

..
. : , 1991. 44 .

3. . . C++Builder 5. :
, 2000. 1152 .

10.

.
K2.011.215

()
,

, ,

.
230282

..

15
2.011.215.

, ,

()
,
(

. . ..

. )
(
,

. ..

.)

16
2.011.215.

2.

,
,
.

( ),
.
2.1

:
1. CGI
2. PHP
3. ASP
4. Perl
5. C# dotNet
6. Delphi
7. Builder C++
:
2.1.1 CGI
CGI , ,
.
CGI- , , ++,
CGI 1. -,
CGI,
. ,
,

17
2.011.215.
. , , ,
. - stdout ,
.

CGI- ,
. -
.

, ,
.
, ,
.
, .
, FastCGI mod_l h.
: FastCGI
CGI-,
mod_l - l h ( CGI).
2.1.2
, HTML- . 4.0
, .
.
(, ,
GET POST COOKIES), ,
, .
,
Windows, Unix,
-
. - HTML-. ,
HTML- PHP-,

18
2.011.215.
.
WEB- .
, C Pascal,
, .

.

2.1.3 ASP
ASP (Active Server Pages) Microsoft CGI. ,
. ASP- JScript VBScript,
. ASP
,
, . ,
GET POST,
.
ASP Microsoft,
ActiveX-, , , ASP- WEB-.
ASP ,
ActiveX-
, Windows NT-,
( .
ASP Linux, Solaris, ..).
2.1.4 Perl
Perl - ,
, . Perl
.
, , , .
Perl C, Shell, sed awk, , ,
Perl- . C Perl-

19
2.011.215.
. UNIX Perl
,
. . Perl
,
.dbm , . Perl
, , C++ Perl-,
.
, Perl
, WEB, .
2.1.5 C# dotNet
Microsoft ,
dotNet. ,
, , ++, ADO+, COM+ ASP+,
, , C# ( ).
. .
, ,
, . ,
, Microsoft dotNet .
C# Java ,
-
. , , ,
, ,
, dotNet.
, dotNet .

2.1.6 Delphi

Delphi ,

Windows, ,
. Kylix

20
2.011.215.
Linux C/C++,
Basic, Fortran. Kylix, - Delphi,
VCL ( Linux/Windows CLX Borland Component Library for Cross-Platform Application)
Linux,
Windows.
Delphi :
Web-
( websnap)

BDE (
dbExpress).
WebSnap Web Broker
Web-.
SOAP (Simple Object Access Protocol - ).
Web- Apache
Windows NT
Server Internet Information Server Linux + Apache.
dbExpress
, MySQL, Oracle, DB2. ,
MySQL
Linux -

Oracle DB2 ( ),
,
Windows NT Server + Microsoft SQL Server
.
, Delphi
Microsoft (
) Linux.

21
2.011.215.

2.2


,
.
:
2.2.1 MySQL

MySQL
,
. Windows- MySQL-, Unix-.

MySQL

SQL-.

,
.
.
. SQL-
, ,

, . ,
, ,
.
2.2.2 MS SQL

MS SQL Microsoft
. MS SQL-
Windows 3.1.
SQL.
.

22
2.011.215.
. :
Microsoft,
, MS SQL-,

. JDBC.
2.2.3 ORACLE

ORACLE
, . ORACLE-

, , ADO, ODBC, JDBC, OLE DB, ..
PL-SQL

Oracle

SQL-. ORACLE

.
.

( 10 MySQL 3
MS SQL), ORACLE-,
.
2.3.

Delphi+Kylix MySQL. -,
, -, ,
, , ,
. ODBC (
Windows), .

23
2.011.215.

3.
, ,
, .
3.1

,
(. 1).

SQL, . ,
, .

SQL

1

SQL,
,

2
. (
. .

N
) , .. .


,
1

1
.
2

. ,
.
.
:

,

; N

SQL.
2

. 1

3.2

24
2.011.215.

, ,
SMTP, HTTP, FTP ..
TCP UDP.
, - TCP
UDP. , TCP -
, . .
, UDP

, .
, UDP ,
, .

. ,
.

TCP ,

() .
, , TCP
.

TCP

(, ),
.
, UDP.

UDP ,

.
, ,
TCP, ,
,
.

25
2.011.215.

3.3 SQL

. ,
,
. , -
,
.

(transaction).
SQL,

.
MySQL
.
:
ADO;
dbExpress.
Active Data Objects (ADO)
, ,
, , .
OLE DB.
ODBC
OLE DB , .
ADO :
, ( DataSource),
.

26
2.011.215.
dbExpress,
.
SQL .
ADO.

, ,
.

3.4

TCPServer

SQL (MySQL);

.. ,

,

, ..
.

,
,

(. 2).

SQL

ADO

. 2

27
2.011.215.

,
, Delphi.
1. TCPServer
TTCPServer.

28
2.011.215.
TObject
TPersistent
TComponent
TBaseSocket
TIpSocket
TTCPServer

. 3
TTCPServer
,
. Host , IP
,
. Port ,
. Accept
. TCPServerAccept()
, socket .
Open() . Close .
Active true, ,
false.

2. ADOConection
TADOConnection.
,
. ConnectionString
SQL. Connected true,
SQL , false.

29
2.011.215.
TObject
TPersistent
TComponent
TCustomConnection
TADOConnection

. 4

Open() : (
) . ,

ConnectionString.
Close() .
3. ADOQuery
TADOQuery.
,
.
ConnectionString
SQL.
Connection TADOConnection.
SQL TStrings, SQL
. ExecSQL , SQL.
RecordCount SELECT
.

30
2.011.215.
TObject
TPersistent
TComponent
TDataSet
TCustomADODataSet
TADOQuery

. 5
TADOQuery
Open . Close
.
FindFirst
. , .. , false.
Next
. ,
.
4. Timer
TTimer.

.
Enabled true, ,
, false.
Interval
, .. 5000 = 5 .

OnTimer

31
2.011.215.

Interval.
TObject
TPersistent
TComponent
THandleComponent
TTimer

. 6
TTimer

TMainWindow.

TForm.
,
, ..
TMainWindow
TCPServer: TTCPServer. TCPServerAccept()
, socket .
TMainWindow IPBegin: String.
, IP .
IP
ip.ini.
.. ,
.
Host= IPBegin
Port=

TADOConnection TADOQuery. ..
MySQL , ADO

32
2.011.215.
ODBC,
MySQL. TADOConnection
ConnectionString,

SQL.

sql.ini,
:
Provider=MSDASQL.1;
Password="";
Persist Security Info=True;
User ID=Wolf;
Mode=Read|Write;
Extended Properties="DSN=sampleMySQL;DATABASE=sdo;SERVER=127.0.0.1;UID=Wolf;PWD=;PORT=3306;OPTION=0;STMT=;"

3. TMainWindow

TcpServer
SQLConnection
ADOQuery
Lesson
FlagOkConnect

TTcpServer
TADOConnection
TADOQuery
TLesson
Boolean

FlagOkConnectDB

Boolean

CountStudents

Integer

St

Array of TStudent

Students

Array of TStudentClass

Onboard

Integer

TCP
SQL
SQL
,
true,
false
SQL
true, false
,
TCP

,


,
,

TMainWindow :
TcpServerAccept ;
IfOkWindow true,
;

33
2.011.215.
IfOkConnect true, SQL
;
PleaseReloadWindowOfAddNewSub

;
PleaseReloadWindowOfAddNewSubItem ,
;
BlobToString , Blob ;
StringToBlob , Blob;
Board ,
.
TLesson.
TestOk, true
, false .
4 TLesson

NumberOfLesson
IdLessonOfDB
NameOfLesson
IdKourse
Kourse
Group
NamePrepod
FlagOk

34
2.011.215.

. 7 TLesson
TStudentClass.
ClientSocket.
.

. 8 TStudentClass
Create().

35
2.011.215.
5 TStudentClass

Caption

ClientSocket
IdOfDBQuery

IsBoard
MarkOnBoard
MsgQuery
NameStudent
OnBoard

,




TRUE ,

TextQuery

FALSE

. 9 TConnectedTCP

TConnectedTCP,
TThread. TConnectedTCP Execute.

TCPServerAccept() TMainWindow,
socket . Execute

36
2.011.215.
.
.
6 TConnectedTCP

ClientSocket
NameStudent


...

TStudents.

. TStudents.
TForm.
. :
;
;
;
;
;
;
.
,
, ,
.
:
ReLoadAnswer , ;
ChangeQuery , ;
SaveOfViewQuery , .
7 TStudent

ClientSocket

NameStudent


...

37
2.011.215.
, Ttimer


, TMemo
, TMemo

Timer1
TextQuery
StClass
Board
QueryText

TForm
:
8.

TAddNewQuery
TaddNewSubItem
TaddNewSub
TEnter
TgoMsg
TMsg
Tsettings
Tstudent
TviewQuery
TViewSubItem
TviewSub

3.5

SQL (MySQL);

TCP;

38
2.011.215.

, ;


SQL, SQL.

,
(. 10).
,
, Delphi.

TCPClient

/
TCPClient.

TTCPClient.

SQL

ADO

. 10

39
2.011.215.
TObject
TPersistent
TComponent
TBaseSocket
TIpSocket
TCustomIpClient
TTCPClient

. 11


TCP .
Host Port. Host , IP

Port

.
Connect() Disconnecet() Connected.

.
,
.

TForm.

:
(TMainWindow);
(TBoard);
(TTests);

40
2.011.215.
(TF9);
(TMessage TMsgView);
(TEnter).

TMainWindow.

TForm.
TCP,
, ..
TMainWindow IPBegin: String.
, IP .
IP
ip.ini.
9 TMainWindow

TCPClient1

TCP
ADOConnection
SQL
ADOQuery
SQL SQL
TextQuery

TextAnswer

Name
...
Group

FlagOkEnter
TRUE
CSt
ConnectSt,
FlagConnected
TRUE SQL

, :
Host= IPBegin
Port=

ConnectSt, TThread.
Execute,

41
2.011.215.
.
TCPClient TMainWindow.

. 12 ConnectSt
SQL
:
1.

.
2.

SQL .
3.

ADOConnection,

. 4, . 7.
4.

5.

10,

. 1.
6.

7.

,
.

42
2.011.215.
TMainWindow
TCPClient: TTCPClient
ADOConnection: TADOConnection
ADOQuery: TADOQuery
CSt: ConnectSt

TBoard

TF9

TEnter

TForm

TThread

ConnectSt

TMsgView

TMessage

TTest

Execute()

. 13 ,

43
2.011.215.

4.

, .
, ,
.
3.1

,
install.php. 10-19.
10. (Prepod)

ID
NAME
PASSWORD

INT(10)
TEXT
TEXT

11. (students)

ID
GROUP
NAME
NSTUD

INT(10)
INT(6)
TEXT
INT(6)

12. (Subjects)

ID
KOURSE
NAME
NUMBER

INT(10)
TEXT
TEXT
INT(2)

13. (SubjectsItem)

ID
ID_SUBJECT

INT(10)
INT(10)

,

TEXTS

TEXT

44
2.011.215.
14. (Tests)

ID
ID_ SUBJECT

INT(10)
INT(10)

TEXTS
VIEW



0-CheckedBox (default)

TEXT
INT(1)

1-RadioButton

15. (AnswerOfTests)

ID
ID_TEST

INT(10)
INT(10)

,
TEXTS
ANSWER


0-

TEXT
INT(1)

1-

16. (MarkStudentsOfSubject)

ID
ID_STUDENT

INT(10)
INT(10)

,

ID_ SUBJECT

INT(10)

,

MARK

INT(1)

17. (MarkStudentsOfTests)

ID
ID_STUDENT

INT(20)
INT(10)

45
2.011.215.
ID_TEST

INT(10)

ID_SUBJECT

ANSWER
MARK

INT(10)
TEXT
INT(1)

18. (Kourse)

ID
KOURSE
ID_PREP

INT(20)
TEXT
INT(10)

19. (Group)

ID
Num

INT(20)
INT(6)


. ,
SQL.

4.2
, ,
:

TCP;

.

Delphi/Kylix TTCPServer.
: Host (IP address), Port SocketID. ,
.

46
2.011.215.

. -,
. -
, .
, ,
,
.

:
-
.
, ,
, IP- ;
- (listening connections)
, .
, ,
, .
,
( );
- , ,
.

. ,

.
.
,
, TConnectedTCP, TThread.
. ,
.

47
2.011.215.
:
1. .
2. .
3. .
4. , .
5. ConnectedTCP ( ).
,
, , , ,
TConnectedTCP, .
TcpServerAccept TMainWindow:

procedure TMainWindow.TcpServerAccept(Sender: TObject;


ClientSocket: TCustomIpClient);
Var //
NewStud: TMenuItem;
s: String;
Name:String;
ConnTCP: TConnectedTCP;
Item: Integer;
i: Integer;
Rel: TStringList;
MsgStud: TStringList;
flagC: Boolean;
begin
//
MsgStud:=TStringList.Create;
flagC:=true;
Rel:=TStringList.Create;
//
ClientSocket.Open;
//

48
2.011.215.
if ClientSocket.Connected then
begin
//
// SQL
ClientSocket.Sendln('STRDB:');
ClientSocket.Sendln(
SQLConnection.ConnectionString);
ClientSocket.Sendln('STRDBEND:');
end;
while ClientSocket.Connected do
begin
//
while ClientSocket.WaitForData(100) do
begin
//
if FlagC then //
s:=ClientSocket.Receiveln;
if Length(s)>0 then
begin
if Copy(s,1,5)='USER:' then //
//
begin
//
Name:=Copy (s,6,Length(s)-5);
CountStudents:=CountStudents+1;
item:=CountStudents;
// TStudentClass
Students[CountStudents]:=TStudentClass.Create();
Students[CountStudents].Caption:='

49
2.011.215.
'+Name;
Students[CountStudents].NameStudent:=Name;
Students[CountStudents].ClientSocket:=
TCustomIpClient. Create(ClientSocket);
Students[CountStudents].ClientSocket:=
ClientSocket;
Students[CountStudents].ClientSocket.Connect;
Students[CountStudents].ClientSocket.Open;
//
//
NewStud:=TMenuItem.Create(self);
NewStud.Caption:=Name;
NewStud.Tag:=CountStudents;
NewStud.OnClick:=N1111.OnClick;
N6.Add(NewStud);
//
//
//
ConTCP[CountStudents]:=
TConnectedTCP.Create(false);
ConTCP[CountStudents].ClientSocket:=
ClientSocket;
ConTCP[CountStudents].ClientSocket.Open;
ConTCP[CountStudents].NameStudent:=Name;
ConTCP[CountStudents].ClassSt:=CountStudents;
ConTCP[CountStudents].Resume;
flagC:=false;
end;
end;

50
2.011.215.
//
ClientSocket.Close;
//
Students[Item].Free;
NewStud.Free;
//
N6.Delete(item);
end;
TConnectedTCP - -.
- TThread. ,
, ,
, , ,
.
.

If MainWindow.TcpServer.Connected then
Begin

while MainWindow.TcpServer.WaitForData(100) do
begin
,
s:=ClientSocket.Receiveln();

I:=GoodMessage(s);

I ,
, I:= 0.
.

51
2.011.215.
,
.
ClientSocket.Sendln(s);
synchAddDataToControl;
end; //
end //
else

MSG('Connect is FALSE');

.
:
-. :
[]
- :



::= + :
::= + END:
. .
20

BOARD

-,

BOARDQUERY


-,

STRDB


-,

MSG

52
2.011.215.
SQL
-,

QUERY


-,

RELOAD

21

MSG

-,

USER

,
RELOAD

-,


- MSG
Execute TConnectedTCP.
procedure TConnectedTCP.Execute;
var
MsgBuf, Rel, MsgStud: TStringList; //
s: String;

//

begin
MsgBuf:=TStringList.Create;
MsgStud:=TStringList.Create;
Rel:=TStringList.Create;
ClientSocket.Open; //
while ClientSocket.Connected do //
//
begin
while ClientSocket.WaitForData(100) do //
//
begin

53
2.011.215.
s:=ClientSocket.Receiveln; //
if Length(s)>0 then //
begin
if s='MSG:' then // -
begin
MsgStud.Clear;
MsgStud.Add(' '+NameStudent);
while s<>'MSGEND:' do
begin
s:=ClientSocket.Receiveln(); //
//
if s<>'MSGEND:' then
MsgStud.Add(s);
end;
ShowMessage(MsgStud.Text); //
//
end;
// ...
//
// ...
end;
end;
end;
end;
SQL.
, .. MySQL
ODBC. SQL
. ,
.

54
2.011.215.
ADOConnection.Open;//
if ADOConnection.Connected then //
begin
With ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('select exts,id from subjectsItem where
id_subject='+IntToStr(MainWindow.Lesson.IdLessonOfDB)
);
ExecSQL; //
Open;
// . . .
//
// . . .
Close;
end;
end;
ADOConnection.Close;

..

TStudent. (. 6):
;
.

TPopupMemu
. , . :
;
;
.
. 13

55
2.011.215.
:
;
.
:
.
:
;
.
.
,
TTimer. 5
RELOAD:
, .
.
,
( TMsgQuery), .
:
;
;
, .
,
.
OptWindow: Integer, :
0 ,
MSG;
1 ,
QUERY.

56
2.011.215.

. 14
,
QUERY.
.
, :
isBoard ( ) onBoard (
) TSdudentClass true;
onBoard (
) TMainWindow;
,
.
RELOAD:

BOARDQUERY
BOARD.
,
.
, ,
TStudentClass.
.
, :
, Tests;
;

57
2.011.215.
;
MarkStudentsOfTests.

. 15 TTests
:
(, , , )
;
(, , , )
;
(, , , )
.

4.3 C
, ..
.
TTCPClient.
, , , ,
, , ,
. : IP
, :
:
1. .
2. .
3. . , . 6.
4. 1.

58
2.011.215.
5. 10, . 1, .3.
6. SQL.
7. SQL.
8. .
9. .
10. .
11. . 13.
12. . 8.
13. USER:< >.
14. .

ConnectSt.
.
While MainWindow.TcpClient1.Connected do
begin
while MainWindow.TcpClient1.WaitForData(10000) do
begin
s:=MainWindow.TcpClient1.Receiveln;
if Length(s)>0 then
begin
//
end;
end;
end;
, ,
, ,
.
, , ,
:
Sendln(String) ;
Receiveln():String , ;

59
2.011.215.
WaitForData(Time: Integer):Boolean .
Time/10 . True, , False.
Receiveln() True
.
MySQL
ODBC. SQL
TADOConection
TADOQuery. ,
.
ADOConnection.Open;//
if ADOConnection.Connected then //
begin
With ADOQuery1 do
begin
Close;
SQL.Clear;
SQL.Add('select exts,id from subjectsItem where
id_subject='+IntToStr(MainWindow.Lesson.IdLessonOfDB)
);
ExecSQL; //
Open;
// . . .
//
// . . .
Close;
end;
end;
ADOConnection.Close;

60
2.011.215.
.
TMenu.
:
;
;
;
;
.

. TForm.

. 16
ConnectSt.
Execute.
procedure ConnectSt.Execute;
//

61
2.011.215.
var
s: String;
i: Integer;
MsgBuf: TStringList;
begin
MsgBuf:=TStringList.Create;
//
While MainWindow.TcpClient1.Connected do
begin
while MainWindow.TcpClient1.WaitForData(10000) do
begin
s:=MainWindow.TcpClient
1.Receiveln;
if Length(s)>0 then
begin
if Length(s)>10 then
if Copy(s,1,10)='SUBJECTDB:' then
begin
MainWindow.IdSubjectOfDB:=
StrToInt(Copy(s,11,Length(s)));
MainWindow.Caption:=
' . '+
MainWindow.Group+' '+
MainWindow.Name;
end;
if s='MSG:' then
begin
MsgBuf.Clear;
MsgBuf.Add(' !');
while s<>'MSGEND:' do

62
2.011.215.
begin
s:=MainWindow.TcpClient1.Receiveln;
if s<>'MSGEND:' then
MsgBuf.Add(s);
end;
ShowMessage(MsgBuf.Text);
end;
if s='QUERY:' then
begin
MainWindow.TextQuery.Clear;
while s<>'QUERYEND:' do
begin
s:=MainWindow.TcpClient1.Receiveln;
if s<>'QUERYEND:' then
MainWindow.TextQuery.Add(s);
end;
ShowMessage (' !');
end;
end;
if s='RELOAD:' then
begin
MainWindow.TcpClient1.Sendln('RELOAD:');
MainWindow.TcpClient1.Sendln
(MainWindow.TextAnswer.Text);
MainWindow.TcpClient1.Sendln
('RELOADEND:');
end;
if s='BOARD:' then
begin
if MainWindow.FlagWindowOfBoard then

63
2.011.215.
begin
MainWindow.WindowOfBoard.Memo1.Lines.Clear;
while s<>'BOARDEND:' do
begin
s:=MainWindow.TcpClient1.Receiveln;
if s<>'BOARDEND:' then
MainWindow.WindowOfBoard.Memo1.
Lines.Add(s);
end;
end;
end;
if s='BOARDQUERY:' then
begin
if MainWindow.FlagWindowOfBoard then
begin
MainWindow.WindowOfBoard.
Memo2.Lines.Clear;
MainWindow.WindowOfBoard.
Memo2.Lines.Add('
:');
while s<>'BOARDQUERYEND:' do
begin
s:=MainWindow.TcpClient1.Receiveln;
if s<>'BOARDQUERYEND:' then
MainWindow.WindowOfBoard.
Memo2.Lines.Add(s);
end;
end;

64
2.011.215.
end;
end;
end;
end;

65
2.011.215.

5.
,
.
,
. ,
Windows 2000
Linux/Unix TCP/IP.
Windows 2000, OC Windows 2000/XP/98/95/Me
Unix/Linux c X- qt qt10.

5.1 MySQL

Linux/Unix ,
:
mysql-server.rpm;
mysql-common.rmp;
mysql-client.rpm;
mysql-doc.rpm;
mysql-odbc.rpm;
mysql-lib.rpm.
,
.
MySQL Windows
setup.exe. . ,
NT,
, .. nt nt-max.

66
2.011.215.
5.2 MySQL

Windows
,
data . winmysqladmin.exe bin
.

. 17 WinMySQLAdmin.exe
:
bind-address , 127.0.0.1;
datadir , data;
port , 3306.
MySQL Linux/Unix :
./var/mysql
;
./usr/local/mysql
mysqlconf;

67
2.011.215.
: bind-address, datadir,
port.
.
1.

5.3 ODBC
ODBC
. MySQL.
, Windows ODBC.
Unix/Linux.

ADO. ActiveX Data Object (ADO)
, ,
, , .
OLE DB.

.

"">"">"

">"

">" (ODBC)". "System DSN"


"Add".

68
2.011.215.

. 18 DSN
: "SQL Server".
, SQL-.

. 19 DSN SQL

69
2.011.215.
.
.

. 20
, .

. 21 DSN

70
2.011.215.
,
"". .
sql.ini,
.

Provider=MSDASQL.1;
Password=""; //
Persist Security Info=True;
User ID=Wolf; //
Mode=Read|Write; //
Extended Properties="DSN=sample-MySQL;
DATABASE=sdo; //
SERVER=127.0.0.1; // IP SQL
UID=Wolf; // SQL
PWD=; // SQL
PORT=3306; //
OPTION=0;
STMT=;"

5.4

Prepodavatel.exe,
sql.ini ip.ini .
sql.ini , .
Windows
Student.exe ip.ini .
Linux *Student ip.ini
.
ip.ini IP- . ..,
:
62.76.48.173

71
2.011.215.

MySQL.

72
2.011.215.

6. -
6.1


, (
), ..
,
.
,
.
,
, .. , -
.
.
,
, , , ,
, . ,
(
).
6.2


, , ,
, ..
- 5.
( . )
,
. 18.

73
2.011.215.
22

-
-

, ()
,
,

(3)
()

,

(12)

,
(22)
Delphi, Kylix
100000


, ,

19 .
:
; ; ; ;
.
,
, .
, ,
( ),
,
( ).

74
2.011.215.
23 ().


./

47
. 4.1., 13

(
)
(
)
(
)
(
)
(
)
(
)
(
)
(
)

(
)

(
)
- 530 ./

47

. 4.1., 13

67

. 4.2., 13

67

. 4.2., 13

68

. 4.15., 5

24

. 4.16., 5

32

. 4.41., 5

130

. 4.42., 5

19

. 4.67., 5

29

. 4.68., 5

().
[1].
1.1 1.5 ,
, 3,

(),

<=

50000

.
1 ,
, 2.08;
2 ,
, 0.40;
3 ,
, 1.05*1.10*1.15=1.33;

75
2.011.215.
= 0.8.


ASP.
5 = 0.6.

,
, .
50%, , ,
0.6.
= 1 * 2 * 3 * 4 * 5 = 2.08*0.40*1.33*0.8*0.6 0.53
.
= *
;

= 530*0.53 = 281 ./

6.3

:
Z- = /
- (.),
- , (.).
:
1. ();
2. ();
3. ();
4. ();
5. ();
6. (..);

76
2.011.215.
7. (, ..) ().

.
:
S = k*n*S1

S = 1.1*1*16840 = 18524 .

k ,

( 1.1 ); n ( 1 . ); S1
( 16840 .).
10 %
:
S = 0.1*S

S = 0.1*18524 = 1852 .

:
S = S + S

S = 18524+1852 = 20376 .

25 % 15 %
:
= 0.25*S + 0.15*S

= 0.25*18524 + 0.15*1852 = 4909 .

5 %
:
= 0.05*S

= 0.05*20376 = 1019 .

:
S = S*S.
S (
,
, ) 122;
S. 12 (2000 .).
S = 12*2000 = 24000 .
2,6% :
= 0.026*S

= 0.026*24000 = 624 .

77
2.011.215.
1.6
% :
= 0.016*S

= 0.016*24000 = 384 .

W :
= W + W
W = S*k*S
W = N*n*k**S
S (122); k ,
1 2 (50 / 2 ); N
(0.35 ); n (1 .); k
, (1.05); S
* (0.9 .); ,
:
= (N N N)*k*F*k*(1 k)
N (365 ), N
(104 ), N (9 ),
k (1, .. ), F
(8 ), k (0.75), k
,
(0.05).
= (365104 9)*1*8*0.75*(10.05) = 1436 .
,
W = 12*50*0.9 = 540 ., W = 0.35*1*1.05*1436*0.9 = 475 .,
= 540+475 = 1015 .
(3.15 . 12 k)
(7 . k):
. = (k**S) + (k**)

78
2.011.215.
(
), , S (122).
. = 3.15*12*12+7*12*1 = 454 + 84 = 538 .
10% .
= (4909+1019+624+384+1015+538)*(1+) = 9338 .
,
:
= n*

(
), (1436 ).
Z- = 9338 / 1436 = 6,51 .

6.4

:
= T**1,356/n + t*Z-
T (281 /),
(1500 .), 1.356 ,
(35.6%), n
(22 ), t (55 /),
Z- (6.51 .), :
= 281*1500*1.356/22+55*6.51 = 26338 .

6.5


.
:

79
2.011.215.
. ,
,

:
, ;
, (


);

,
);

, ;
, , , ...
:
Cmax = C*( 1 + r )*( 1 + k )
C (26338), r
(10%), k , (20%).
Cmax = 26338*(1+0.1)*(1+0.2) = 34766 .
- Internet;
,
, ,
. 30
.

:

n = Cmax/n + C

n ,
(30), Cmax (35039 .), C
(

80
2.011.215.
, .. 50 .*2 = 100 .,
), :
n = 34766/30+100 = 1169 .
, ,
,
.

6.6

,
-
. ,
. , ,
.

E-Shop, Internet-e,
,
.
,
:
1.

() .

Windows XP;
2.

).

,
;
3.

, WEB- ,
;

81
2.011.215.
( )

4.

,
;
5.

. ,

.
10 .
(..
).
E-Shop- 65$ ( 65*32 =
2080 .), ,
50$ (50*32 = 1600 .).

(. 20).
24 .


1
2
3
4
5

-Shop


6
6
5
7

5
5
4
7


5
5
3
7


, 2528.

25 1.

1
2
3
4
5

1
1
0
2
0
0

2
2
1
2
2
0

3
0
0
1
0
0

4
2
0
2
1
0

5
2
2
2
2
1

= 25
i-
7
3
9
5
1

82
2.011.215.
26 2.

1
2
3
4
5

1
1
2
2
0
0

2
0
1
2
0
0

3
0
0
1
0
2

4
2
2
2
1
0

5
2
2
0
2
1

= 25
i-
5
7
7
3
3

27 3.

1
2
3
4
5

1
1
0
2
2
0

2
2
1
2
0
0

3
0
0
1
0
2

4
0
2
2
1
0

5
2
2
0
2
1

= 25
i-
5
5
7
5
3

28 4.

1
2
3
4
5

1
1
2
0
0
0

2
0
1
2
2
0

3
2
0
1
2
2

4
2
0
0
1
2

5
2
2
0
0
1

= 25
i-
7
5
3
5
5

29 .

1
2
3
4
5

i-
0.24
0.20
0.26
0.18
0.12

,
:
,
.
30 .

E-Shop

83
2.011.215.

1
2
3
4
5

1.00
1.00
1.00
1.00
1.00

0.75
0.83
0.83
0.80
1.00

0.88
0.83
0.83
0.60
1.00

(IJ):
E-Shop = 1.00*0.24 + 1.00*0.20 + 1.00*0.26 + 1.00*0.18 + 1.00*0.12 =
1.000;
= 0.75*0.24 + 0.83*0.20 + 0.83*0.26 + 0.80*0.18 + 1.00*0.12 =
0.826;
. = 0.88*0.24 + 0.83*0.20 + 0.83*0.26 + 0.60*0.18 + 1.00*0.12
= 0.821.
27.
31 ( - J).

E-Shop

2080
1368
1600

1
0.66
0.77

(KJ):
E-Shop

(KJ1) = 1.000 / 1

= 1.00;

(KJ2) = 0.826 / 0.66

= 1.25;

(KJ3) = 0.821 / 0.77

= 1.07.

,
. , , :
, -
,
, , -, , ,
,
. ,
.

84
2.011.215.

6.7
.

(,

/ , )
,
() .
, 20 .
3 ,
20 - 7 ,
2
. 1 11
, (20-11)*7*4 =
252 . 50 ,
252*50=12600, - 12600*9=113400.
, .
50, 80 ,
11*7*4*(80-50)=9240 , 9240*9=83160
. 113400-83160=30240 .
252/2/5=25 .
7 , 25/7=3 ,
.. 3*30*8=720 2. , .3,
720*1950*(1+0.042)=1462968 . , , ,
, ( ,
- ) 1% .
2925936*0.01=14630 . .

85
2.011.215.
, 30,
32 , .. 2 ,
. 1000 ,
1000*2*2=4000 .
4 ( -
). 4000*4=16000.
(35.6%), 16000*(1-0.356)=10304 .
,
.
, .

, (
5-10 Pentium).
42947 ,
11381 2362 .
,

. 800
, 9600 .
30240+14630+10304113812362
9600= 31831 . .
, 10% ,
28648 .
,
.

(
,
1169+42947=44116 ).

86
2.011.215.
32 .

2004
2005
2006
2007

. -

, n

t = - n

, It

28648
28648
28648
28648

44116
-

-15468
28648
28648
28648

1/(1+0.25)
0.8
0.64
0.512

t* It

1*(-15468)
22918
18335
14668


-15468
7450
25785
40453

It = 1/(1+i)t-1, i (25%,
).
, ,

. ,

.
, ,
.

87
2.011.215.

7.
7.1


, ,

.

:
.
:
1.

;
2. ;
3.
,

;
4. ,
;
5.

,
.
:
1.

(,

);
2. ( );
,
. :
1. ;

88
2.011.215.
2. ;
,
,
.
7.2

,
10-12 , .
: : 13 x 6 x 3 , 10
4 , 1.9 1.3
.
1.2
3 .
:
1. (
) (11 .);
0.7 0.5 0.6
0.25 0.4 0.6
:
1.

1.3 0.6 0.76 (10 .);

2.

1.3 0.6 0.76 ;

3.

1.6 0.8 0.76 ;

4.

0.5 x 0.47 x 0.87 (13 .);

5.

0.36 0.78 2.2

2.2.2/2.4.1340-03
6.0 2.
, :
S =
S , 78 2;
N , 11 .
:

S
,
N

89
2.011.215.
S =

78
= 7.09 2
11

, 2.2.2/2.4.134003. - . 22.

3
6

5
2

. 22 - . : 1
; 2 ; 3 ; 4 ; 5
; 6 ; 7 .

90
2.011.215.
7.3

, 12.1.005-88,
,
,
.
1 (,
, 150
/). 2.2.2/2.4.1340-03
,
( 29).
33
.



( +10
)

( +10
)

, %

, /

20-24

75

0,2

21-28

40-60

01-03

2.2.2.542-96

, ,
.
,
:
L=

Q
,
c * * (t t )

Q , /;
c , c = 1.005 /*;

, = 1.2 /3;
t , ;

91
2.011.215.
, .

:
Q = Q + Q + Q + Q + Q ,

Q ;
Q ;
Q ;
Q ;
Q , .
:
Q =3600*N*k1*k2,

k1 , 0.92;
k2 , 0.3;
N , 3.85 .
N =n * N ,

n , 11 .;
N , 0.35 ;
Q = 3600*3850*0,92*0,3 = 3825.4 /.
:
Q=3600**N,

N , N = 24*40 = 960 ;
, 0.5.
Q = 3600*960*0.5 = 1728 /
:
Q = n*q,

n , , 10 ;
q , , 360 /.
Q = 10 * 360 = 3600 /
, ,
:
Q = F*k*(t t)*,

92
2.011.215.
F , 13*3
4*1.9*1.3 = 29.12 2;
k , 23 /(2**);
t , 27;
t , 24;

, 0.1.
Q = 29.12*23*(22 18)*0.1 = 269.7
, ,
:
Q = q*S,*k1 * k2
q , 56
, , q =
135 /(2*);
k1 , (0.5)
k1 , (0.8)
S , 4*1.9*1.3 = 9.88 2.
Q = 135*9.88*0,5*0,8 = 533,52

:
Q =3825.4 + 1728 + 3600 + 269.7+ 533.52 = 10974.32 /
L=

10974.32
2274.9 3 /
(22 18 )*1.005*1.2

RAS-30CH

Hitachi,

2200 2750 3/.


7.4


,
.

93
2.011.215.
300 - 500
. 2.2.2/2.4.1340-03
.
:
F*N =

100 * E * S * k * z
,

N ;
, 300 ;
S , 78 2;
k , 1.4;
z ,
1.1;

,
:
: = 0.7, = 0.3, ..=
0.1;
:
i=

a *b
,
h * ( a + b)

a b , h .
i=

13* 6
= 1.82
(3 0.75)*( 13 + 6 )

.
, -40,
F = 3120 . :
N=

100 * * S * k * z
,
F *

N=

100 * 300 * 78 *1.4 *1.1


24
3120 * 48

12 36-240,
40 .

. 13.

94
2.011.215.

1250

3500

750
225
0

. 23 .

7.5

,
, ,
.

95
2.011.215.
,
,
. -99

(NUTEK)

,
. , ,
:
1.

0.5
:
) 2 10 /
) 2 1 /

2.

0.5
:
) 2 200
) 2 25
2.2.2/2.4.1340-03

- 35 /2;

- 100 ;

16 ..

600-700 .


Samsung Samtron 757 MB,
, ,
.
, , ,
, ,
.
7.6 , ,

96
2.011.215.
,
.
,
. , ,
. :
1. :
- : 1300 ;
- : 600 ;
- : 760 .
2. :
- : 1300 ;
- : 600 ;
- : 760 ;
- : 3.
3. :
- : 1600 ;
- : 800 ;
- : 760 .
4. :
- : 500 ;
- : 470 ;
- : 460 ;
- : 410 ;
- : 2;
- : 3;
- ;
-
.
, .
MidiTower CAT Codegen ATX,

Genius Multimedia KB-18M, Genius NetScroll Plus

Samsung Samtron 757 MB.


,
200 , : 1152 864 100 .

97
2.011.215.

.
,
. II.
4 , 8 .
8 17 .
12 , 1 , 20 ,
1.5 .
-

.
7.7
,
, ,
,
. :
, ,
() .
12.1.038-82
, ..

.
,
, ,
.
,
.
.
, - 220 , - 50 .
- . ,
, R=100 / ( ,
). .

525 30,01 .

98
2.011.215.
:
R =

R * R
R * + R * * n

R , ;
R R , ;
;
n .
:
R =

2.1 * l 1
4 * h + l
* ln
+ * ln
,
2 * * l
d
2
4 * h l

h , 2.1 ;
l , 3 ;
d - , 0.01 ;
, = * = 100 * 1.5 =
150 * ( ).
R =

150
4 * 2.1 + 3
2.1 * 3 1
* ln
+ * ln
= 47.17
2 * * 3
0.01 2
4 * 2.1 3

:
R =


2 * * L

* ln

2 * L2
,
d * h

L , ;
, * .
,
,
:
L = 1.05*n*a
n
:

*n = R / R.,
R , 4 .

*n = 47.17 / 4 = 11.8
n = 27, n = 0.45, L =
1.05*27*3 = 85.05.
= 0.47 = 0.27,

99
2.011.215.
= 3,
= 100*3 = 300.
:
R =

300
2 * 85.05 2
* ln
= 7.3
2 * * 85.05
0.05 * 0.7

:
R =

47.17 * 7.3
= 3.3
47.17 * 0.27 + 7.3 * 0.47 * 27

R 4 .
,
, .
7.8

, .
:
1. ;
2. ;
3. .
: ,
, ,
, , .
,
,
, .
2.09.02-85
, III.
, ,
, , ,

. ,
, ,

100
2.011.215.
. - (-028),
(
, ). .

-5, 40-502 .

.

101
2.011.215.


1. Microsoft

Developers

Network

(MSDN)

Library:

Scripting

technologies.
2. .. . Delphi 6. .:
, 2003 . 1120 .: .
3. . ASP. .
.: , 2001 400 .
4.
: 01.02
, 22.02 .
.. , .. . , 1993
5.

2.2.2/2.4.1340-03

, , , ,

.
6. : ;
; . .. .: , 1979
7. . - .:
, 1989
8. . . :
Web- . .
2-, . - .: - ,
2000. 448 .

102
2.011.215.

1
<html>
<body>
<?
include("db.php");
include("dbi.php");
mysql_connect($dbhost,$dbuser,$dbpassword);
mysql($dbname,"drop table prepod");
mysql($dbname,"create table prepod(id int(10),name
text,password text)");
mysql($dbname,"drop table kourse");
mysql($dbname,"create table kourse(id int(10),kourse
text, id_prep int(10))");
mysql($dbname,"drop table groups");
mysql($dbname,"create table groups(num int(6))");
mysql($dbname,"drop table students");
mysql($dbname,"create table students(id int(10),name
text,group_num int(6),nstud int(6))");
mysql($dbname,"drop table subjects");
mysql($dbname,"create table subjects(id
int(10),id_kourse int(10),Name text, number
int(2))");
mysql($dbname,"drop table subjectsItem");

103
2.011.215.
mysql($dbname,"create table subjectsItem(id
int(10),id_subject int(10),texts text)");
mysql($dbname,"drop table tests");
mysql($dbname,"create table tests(id
int(10),id_subject int(10),texts text, view
int(1))");
mysql($dbname,"drop table AnswerOfTests");
mysql($dbname,"create table AnswerOfTests(id
int(10),id_test int(10),texts text, answer int(1))");
mysql($dbname,"drop table MarkStudentsOfSubject");
mysql($dbname,"create table MarkStudentsOfSubject(id
int(10),id_student int(10),id_subject int(10), mark
int(1))");
mysql($dbname,"drop table MarkStudentsOfTests");
mysql($dbname,"create table MarkStudentsOfTests(id
int(10),id_student int(10),id_test int(10),id_subject
int(10), answer text, mark int(1))");
mysql_close();
$db= new dbi;
$db->connect(dbname);
$db->query("insert into prepod values('1','
','')");
$db->query("insert into prepod values('2','
','')");
$db->query("insert into groups values('230282')");

104
2.011.215.
$db->query("insert into kourse values('1','
',1)");
$db->query("insert into kourse
values('2','',2)");
$db->query("insert into Students values('1','
', '230282', '980633')");
$db->query("insert into Students values('1','
', '230282', '980633')");
$db->disconnect(dbname);
?>
</body>
</html>