1С Предприятие 7.7-8.0 Системное Программирование

  • Published on
    26-Dec-2015

  • View
    283

  • Download
    4

DESCRIPTION

programare

Transcript

  • ( http://librus.ru ) - . , ( , , , , ..). - e-book' (, , ). , . Internet - . ! ! . , " ". . . , , , , . .

    librus

  • 7.7/8.0

    OLE, COM,I ActiveX

    WSH WMI

    ADOSQL-DMO

    TJVE DIRECTORYRVICE INTERFACES

  • 1C:

    7.7/8.0

    -

    -

    2005

  • 681.3.06 32.973.26-018.2

    69

    . .

    69 1: 7.7/8.0: . .:-, 2005. 336 .: .

    ISBN 5-94157-536-

    ,

    -

    "1:" 7.7 8.0. ActiveX, - Windows WMI WSH, ADO SQL-DMO, OLE Automation . "1C:". - -

    , -.

    681.3.06 32.973.26-018.2

    :

    . .

    .

    .

    02429 24.07.00. 20.12.04. 70x100'/. . . . . 27,09.

    4000 . 722"-", 190005, -, ., 29.

    -

    77.99.02.953..006421.11.04 11.11.2004 . .

    " ""

    199034, -, 9 , 12

    ISBN 5-94157-536- . ., 2005 , "-", 2005

  • 9 9 9 11 CD-ROM 12 12

    1. ActiveX 13

    ActiveX 13 Internet Explorer 15

    '. 15 HTML- ...16 POST- HTML- 17

    "Microsoft Winsock" 20 IP- 21 IP- 21

    ActiveX ActiveBarCode ..* 22 ActiveX Windows Media Player 24 Microsoft Agent 26

    MS Agent 26 MS Agent 27 MS Agent 36

    HTML- 45 52

    2. Windows WMI 59

    WMI 59 WMI 61 67 69

  • 70 71

    71 73 . 73 74 74

    75 76 76 77 77 Windows XP/Server 2003 77

    78 78 79 80 80 81

    82 '. 82 82

    83 84 84 85

    85 86 86 87

    87 88 89

    89 90 90

    91 92 92 93

    93 93 MAC- IP- 94 Ping 94

  • 149 151 153 154 MS Word 155 MS Word 159 MS Word 161

    Microsoft Excel 164 MS Excel, 164, MS Excel 165 166 168 MS Excel 169 MS Excel 173

    Microsoft PowerPoint : 176 MS PowerPoint ..176, 177

    v 179

    Adobe Photoshop 181

    5. ADO 185 ADO 185 187 SQL- 192 198 (ADOX) 202

    ... 203 206 208

    Microsoft Excel OLE DB 209 Microsoft Project OLE DB 214

    6. SQL-DMO 227 SQL-DMO 227 228 229

    230 ..233 233

    234 234 236

  • 3. WSH 97 WSH 97 WSH 97 VB- (VBS) 98 100

    , 100 102 , 104 104 105 105 105 106 , 108 - 109

    112 Windows 114

    114, 115 URL- 116

    Windows 116 116, 117

    119 119 120 121

    : 122 125 Microsoft Word 125 126 "1:" 126

    4. OLE Automation 129 OLE Automation 129 "1:" OLE Automation 130

    OLE Automation 7.7 131 OLE Automation 8.0 135 - 8.0... 143

    Microsoft Word 146 MS Word 147, 147

  • SQL- 246 SQL- 248 251 253

    7. Windows, ruiuU132 261

    rund!132 261 262 269 271 272 276

    8. - 281

    281 mailto 281 MAPI 282 V7Plus.dll 286 Rom-Mail.dll 289 295 298

    FTP 303 ftp.exe 303 FTPCoeduneme 310

    9. Active Directory Service Interfaces 313

    ADSI 313 WinNT Provider 314 317 318 318 319 320 321

    . - 329

    333

  • -?

    .

    ? - . ,

    .

    -

    -

    -

    1: 7.7/8.0. -,

    . -

    -

    .

    -

    ,

    -

    -

    ,

    .

    : (095) 975-0442; (8162) 112-120

    : info@tehuspeh.ru : www.tehuspeh.ru

  • "1C:" - 7.7 8.0, .

    ,

    , "1:". : ActiveX,COM, WMI WSH; OLE Automation; - ADO SQL-DMO; , FTP; .

    , -

    "1C:" . ,

    "1:" - ,

    .

    "1:". ,, , -

    -.

    , -

    .

    (7.7 8.0).

    1 " ActiveX". ActiveX. -,

  • .

    , ActiveX.

    . ,

    Internet Explorer, Microsoft Winsock, ActiveBarCode, Windows MediaPlayer ActiveX, Microsoft Agent . 2 " Windows WMI". -, -

    Windows Management Instrumentation (WMI). ,

    ; ; ; ; - ; , . , -

    , WMI. 3 " WSH". -

    Windows Script Host (WSH). , WSH, , , Windows, ,

    .

    WSH, - , -

    .

    4 " OLE Automation". OLE Automation. OLE-, Microsoft Word, Excel, PowerPoint Adobe Photoshop. - "1:" 7.7 8.0 OLE Automation, - 8.0. OLE-, - ,

    OLE Automation. 5 " ADO". -

    Microsoft ActiveX Data Objects (ADO). ADO, , -

    , .

    ADO ADO Extensionsfor Data Definition and Security (ADOX),

  • 11

    ,

    , .

    6. " SQL-DMO". Microsoft SQL Server SQLDistributed Management Objects (SQL-DMO). Microsoft SQLServer, , , SQL-. -

    Microsoft SQL Server, .

    7 " Windows, rundll32".

    rundll32, , DLL-. -

    , , .

    8 "-". - ,

    "1:" 7.7 8.0.

    , , -

    Messaging Application Program Interface (MAPI), , .

    FTP. 9 " Active Directory Service Interfaces". , ActiveDirectory Service Interfaces (ADSI). WinNT Provider, , ,

    .

    "1:" 7.7 8.0. - Microsoft Windows 2000 .

    -, -

    -.

  • _J2

    CD-ROM CD-ROM , -, . , -

    Offline- - ERP Group (www.erpg.ru), .

    -, -

    :

    http://www.ospi.ru " "; http://msdn.microsoft.com Microsoft Developer Network; http://rusproject.narod.ru " ", . ; http://admtech.mrsu.ru

    . . . " Windows"; http://avblc.narod.ru ; http://www.erpg.ru "ERP Group". -

    .

  • 1

    ActiveX

    ActiveX .

    Component Object Model ( - ). " ".

    . ,

    ,

    . -

    (DLL, EXE), "" , .

    , . , -

    -

    . , - -

    , .

    .

    ,

    .

    ,

    "1:", . , ( ) .

    ( ) Microsoft, ,

    Microsoft Windows 9x Microsoft Windows NT. Microsoft Macintosh. Microsoft - ,

  • 14 1

    . , ,

    .

    ActiveX COM. ActiveX , Microsoft - . , -

    , ,

    -

    - -

    ( ). ActiveX- :' (, Microsoft Agent, Progress Control, Slider Control,

    , .); , - -

    .

    ActiveX : , , -

    ,

    " " (ActiveX);

    , -

    , Open Group, - ( , Microsoft Metro-werks Bristol ActiveX Macintosh UNIX);

    -

    , , ActiveX Visual Basic, Visual C++, Borland Delphi, Borland C++,1: ;

    ActiveX, -

    ; , , ActiveX

    (TCP/IP, HTML, Java), - , , Microsoft - OLE, .

    , -

    "1:", , , -

    "1C". -

  • ActiveX 15

    , -

    . ,

    - ActiveX- "1:". "1:" ( 7.7) - - = (""). 8.8 . -

    .

    Internet Explorer-, Microsoft Internet Explorer, - . , -

    Web- -, ,

    GET POST- . -

    Windows, HTML-. -.

    , -

    , internet Explorer , 1.1, .

    objIE = ("InternetExplorer.Application");objIE.Visible =0; // objIE.Navigate("about:blank"); // objIE.readyState < 4 // ;

    oScreen = objIE.document.parentWindow.screen;(" : " + oScreen.width + "" +oScreen.height);

    ". 7.7". 8.0 "" " ".

  • 16 1

    obj IE obj IE. readystate < 4 objiE.busy ( ), Windows 9x - .

    Internet Explorer, - , -

    -

    .

    WSH WMI, - .

    HTML- Microsoft Internet Explorer Document, - HTML ( , JScript: window.document). - HTML- .

    Internet Explorer - HTML-, www.erpg.ru( 1.2 1.3). , ,

    ( ) - .

    objIE = ("InternetExplorer.Application");objIE.Visible = 0;objIE.Silent = 0;objIE.Navigate(); objIE.readyState

  • ActiveX 17

    8.0

    objIE = ("InternetExplorer.Application");objIE.Visible = ; // objIE.Silent = ;objIE.Navigate();(" . ..."); objIE.readyState

  • 18 1

    PostData. , , - "1:" . , -

    SafeArray, "1C:" 7.7. POST- internetExpiorer.Application "" Submit ( , ) - HTML-. - , , POST-, , HTTP_REFERER,. . , () cookie , , POST-. 1.4 1.5 - " ". ,

    7.7, 1.4, HTML- (. 1.1) , http://forum.erpg.ru.

    ;

    :

    | "" .!

    .

    . 1.1. HTML-

    HTML-

    objIE = ("InternetExpiorer.Application");objIE.Visible = 0;objIE.Silent = 0;objIE.Navigate("http://erpg.ru/frum/posting.php?mode=reply&t=34") objIE.readyState

  • ActiveX 19

    // " "objForm.elements("username").value = ();

    ;

    objForm.elements("subject").value = ();objForm.elements("message").value = ();objIE.Visible = 1;("HTML- . Internet Explorer.");

    , 7.7 - HTML- - , click ,

    Internet Explorer. , - ,

    submit: obj Form, submit . 8.0 "1:" -,

    .

    (. 1.5).

    objIE = ("InternetExplorer.Application");objIE.Visible = ; // objIE.Silent = ;objIE.Navigate("http://erpg.ru/forum/posting.php?mode=reply&t=34");(" . ..."); objIE.readyState

  • 20 1

    objForm.elements("message").value = ;objForm.elements("post").click(); // ""(" : " +"http://erpg.ru/forum/viewtopic.php?t=34");objIE.Quit(); // objIE = ;

    - -

    ,

    ......

    ( username). , - , username .

    , -

    , username .

    "Microsoft Winsock"Microsoft Winsock ActiveX, - TCP UDP . -, -

    .

    Winsock : ByteRecived ,

    ;

    LocaiHostName ; Locaiip IP-

    (...); LocaiPort ;

    . 0, . -

    .

    TCP-. -. 0, . Listen , .

    Protocol , Winsock ( TCP, UDP);RemoteHost IP- - , ( - IP-, FTP-);

  • ActiveX 21

    RemoteHostip IP- ; RemotePort -

    (, : 80 HTTP,26 - FTP);

    state .

    IP- IP- LocaiiP winsock. 1.6 , .

    IP-

    Winsock = ("MSWinsock.Winsock");(Winsock.LocaiiP) ;Winsock = ;

    IP- IP- RemoteHostip winsock. 1.7 , .

    Winsock = ("MSWinsock.Winsock");Winsock.Connect(, 139); Winsock.State = 4 // ;

    -

    (Winsock.RemoteHostIP);Winsock = ;

    , .

    TCP- 139, -, , .

    Connect , - , .

    -

    state.

  • 22 1

    ActiveX ActiveBarCode -

    , -

    .

    .

    20 ( ), , , . , -

    .

    , "1:" - -

    ActiveX- ActiveBarCode. - "1:". - , -

    , ,

    .

    ActiveBarCode , . , :

    Text ( ); (

    http://www.activebarcode.com); AutoType -

    ;

    showText ;

    ForeCoior ; Backcoior ; Font . Barcode.ocx, , -

    regsvr32 Barcode. .ActiveBarCode , . . - . ,

    ActiveX- - "1:". , 7.7 ActiveX- ( ). .

  • ActiveX 23

    7.7. , -

    . - , -

    ActiveBarCode ( MS Word,"1:" 8.0 .), 7.7. , -

    (. 1.2).

    L;

    ..! = ();..! = ;.. = ;

    W

    . 1.2. ActiveBarCode

    "" ( 1.8).

    .("");.("");.("");

    , :

    1. ActiveBarCode .

    2. , , , (, ).

  • 24 1

    8.0 "1:" . ActiveX- ( | ActiveX ActiveBarcode), (- | | )., ActiveBarcode , , 1.9.

    .. = ;

    ..Text = ;..ShowText = ;..AutoType = ;

    (. 1.3).

    jj ActiveB aiCode

    : [23456739:

    0 iQS]

    . 1.3. 8.0

    ActiveX Windows Media PlayerActiveX- Microsoft Windows Media Player , , -

    (JPG, BMP .). , -

    .

  • ActiveX 25

    Windows Media Player. 9.0, - http://www.microsoft.com/windows/windowsmedia/download/default.asp.

    ^

    , "1:" 7.7 - ,

    .

    Windows Media Player "1C:" .

    1. ActiveX- ActiveX. WindowsMedia Player.

    2. , - ActiveX- ( 1.10).

    -WMP.settings.autostart = True; // .WMP.URL = ;

    ((), 10, "");;

    ......

    ,

    . WMP ActiveX-. ActiveX Windows Media Player (tag, Bitrate .). 1.11 - .

    'ActiveX Windows Media Player j

    .WMP.settings.autostart = False;.WMP.URL = ;

    // ,

  • 26 1

    CM = ..11;

    // (" : " + CM.getItemInfo("SourceURL"));

    // = 0 CM.attributeCount-1 = CM.getAttributeName(); = CM.getltemlnf(CM.getAttributeName();( + " = " + );

    ;

    ((), 10, "");;

    Microsoft Agent

    MS AgentMicrosoft Agent , . -

    -

    , ,

    " 1 : ". Microsoft Agent - ( Microsoft Speech Application Programming Interface,SAPI 4.0), . (text-to-speech,TTS), . ,

    . Microsoft Agent ActiveX, - "1C:". Office 2000 Windows 2000. Microsoft Agent Windows 98 WindowsNT 4.0 Web- Microsoft (http://www.microsoft.com/msagent/). Microsoft -, . Merlin, Genie, - Robby Peedy (. 1.4).

  • ActiveX 27

    . 1.4. Microsoft Agent

    ,

    .

    ^

    Microsoft Microsoft Text-To-Speech , "" ( Lernout&Hauspie TTS3000), "" - Microsoft. , - Microsoft Agent Control 2.0 Merlin.

    MS AgentMicrosoft Agent , - , ,

    . Microsoft Agent - , .

    , . 1.5, .

    "1C:" Microsoft Agent ("Agent. Control. 2 " ) , 7.7, ("Agent.Control.2"), 8.0. , , -

    , (- 1.12).

    // Agent = ("Agent.Control. 2 ")

  • 28 1

    ("MS Agent !");

    (" MS Agent Microsoft http://www.microsoft.com/ms agent/");

    ;

    ;

    Agent.Connected = ; //

    Agent.Characters.Load("Merlin", "Merlin.acs"); //

    Agent.Characters("Merlin").Show(); //

    , 1.12, . , ,

    Load, : HTTP-. Microsoft Agent %WinDir%\MSAgent\Chars ( %WinDir% , - Microsoft Windows). ,

    . Microsoft Agent - : (ACS) - (ACF, ), http-.

    LJ

    '-- '. 1=; --4 ^S ..'-^ f =} ft :.; * - 1.5

    i 1 . ,.

    : L

    | ^ 6212:'"|1| 02.06.2003 12: 00: 00

    it*: > 02.06.2003 19:30:22

    !tf*j 103.06.20031:18:57" "!r* |22:kX i 03.06.2003 12:00:01f,3f "^"

    IEa .

    ''!?1""" "

    ""

    ""

    '"

    "

    "

    '"" "

    [^ ! |__^ I

    ~75. '... ;|

    75.1 ~ ..7"

    80

    80"

    ; ? _ X

    _ { .0000000013 | ...

    .

    0...'";:;!...

    0000000018 ...000066020 ? "... v

    ::~ ^ ; | "^.;^ i |

    ( KfE

  • ActiveX 29

    . -

    .

    show - .

    Hide, . , ,

    ( 1.13). ShowDefaultCharacterProperties Agent . -

    ( ) (X, Y),

    .

    1.13. MS Agent

    Agent = ("Agent.Control.2");

    ("MS Agent !");;

    ' ;

    Agent.Connected = ; // // Agent.ShowDefaultCharacterProperties(4, 4);Agent.Characters.Load(,); // Agent.Characters("").Show(); //

    "" ,

    . . . MS Agent -: MoveTo Play. , Agent, ( 1.14).----'"'""'---------"--"--"-- - -^ ------------ .-- -j! 1.14. MS Agent

    Agent = ("Agent.Control.2");

    ("MS Agent !");

  • 30 1

    ;

    ;

    Agent.Connected = ; // Agent.Characters.Load("Merlin", "Merlin.acs"); // Characters = Agent.Characters("Merlin"); // Characters.Show(}; // // Characters.MoveTo(100, 100); // (X, Y)Characters.MoveTo(200, 0, 500); // 500 Characters.MoveTo(300, 100, 0); //0 - // = 1 5

    // Characters.Play("GetAttentionContinued");

    ;

    Characters.Play("Search"); //

    MoveTo -.

    (X, Y) . - .

    1000 . - .

    Play , .

    , -

    .

    -

    , AnimationNames, . , 7.7 "1C:" - . 8.0 ,

    1.15.

    Agent = ("Agent.Control.2");

    ("MS Agent !");

  • ActiveX 31

    ;

    ;

    Agent.Connected = ; // Agent.Characters.Load("Merlin", "Merlin.acs"); // Characters = Agent.Characters("Merlin"); // // . . Characters.AnimationNames() ();

    ;

    Microsoft Agent . .

    , , -

    Request, .

    Microsoft Agent . , , Agent - .

    , stop, (, , ) StopAll.

    Microsoft Agent , : ,

    .

    - , Think, Speak ( 1.16).

    f MS Agent

    Agent = ("Agent.Control.2");

    ("MS Agent !");;

    ;

    Agent.Connected = ; // Agent.Characters.Load("Merlin", "Merlin.acs"); //

  • 32 1

    Characters = Agent.Characters("Merlin"); // Characters.Show(); //

    Characters.Think(" , !"); // // Characters.Speak(" !] ?");Characters.Speak(" ", "welcome.wav"); // WAV

    Think ( ). speak - .

    . , -

    (WAV LWV). - ( ), URL-( http-).

    ^

    ,

    . , -

    .

    (|) - .

    .

    Speech Output Tags, (, . .). , - , 1.17. \chr\ , -

    Normal ( ), Monotone () whisper (). Normal.

    \ctx\ . Address , E-mail Unknown . - Unknown.

    \Lst\ , . \\ , . \\ . -

    (\=\). \Pi t\ .

    (\pit=so\).

  • ActiveX 33

    \Spd\ . , - , -

    (\Spd=100\). \vol\ . -

    0 65 535 (\voi=65535\).

    // , Characters.Speak("\Chr=""Whisper""\, ...");// , Characters.Speak(" : \Ctx=""E-mail""\mav@erpg.ru");// Characters.Speak("\Lst\") ;// , Characters.Speak("\map="" !""="" www.erpg.ru""\");// Characters.Speak("!\=1000\ ?");// Characters.Speak("\pit=50\He ! \pit=300\CTOU! \pit=500\He -!");// Characters.Speak("\Spd=100\KaK !");// Characters.Speak("\Vol=20000\He , !");

    .

    MS Agent . , . . "1:". MS Agent. Name (, , , ); Description ; ExtraData ;

    version ; visible 0, Hide, 1,

    ;

    AutoPopupMenu - ,

    2 . 722

  • 34 1

    ( );

    Languageio ;

    Height - ;

    width - ;

    Left ; ;

    OriginalHeight , - () ;

    originaiwidth , - () ;

    TTSModeiD Text-to-Speech (TTS) .

    1.18 .

    Agent = ("Agent.Control.2");

    ("MS Agent !");(" MS Agent Microsoft

    http://www.microsoft.com/msagent/");;

    ;

    Agent.Connected = ; // Agent.Characters.Load("Merlin", "Merlin.acs"); // Characters = Agent.Characters("Merlin"); // Characters.Show(); //

    // (" = " + Characters.Name);(" = " + Characters.Description);(" = " + Characters.ExtraData);

  • ActiveX 35

    (" = " + Characters.Version);(" = " + Characters.Visible);(" = " + Characters.AutoPopupMenu );

    // Characters.Height = Characters.Height * 2;Characters.Width = Characters.Width * 2;// Characters.AutoPopupMenu = ;

    Balloon. Balloon , .

    BackCoior ; Bordercoior ; Enabled ; FontcharSet (, 0 ANSI); FontName ; FontBoid ; Font italic ; Fontsize ; Fontunderiine ; Forecoior ; NumberOfLines ; style ; visible . BackCoior, BorderColor, FontBoid, Fontltalic, FontUnderline,Forecoior . Microsoft Agent, - .

    1.19.

    Characters.Balloon.FontName = "Comic Sans MS";Characters .Balloon. FontSiz-e = 24;Characters.Think(" , !")

  • 36 1

    MS Agent, , -

    . -

    MS Agent ( , , . .), , . . MS Agent . , -

    , ( $10). BalloonDialog 6.5 ActiveX SommyTech.

    ^

    - BalloonDialog 6.5 http://www.sommytech.com.ar.

    BalloonDialog : MS Agent; (

    ); ( -

    ); (

    );CD ( ); , ,

    , , .

    !

    . 1.6. BalloonDialog Microsoft Agent

  • ActiveX 37

    . BaiioonDiaiog, - MS Agent ( 1.20). . 1.6 .

    // Agent = ("Agent.Control.2");

    ("MS Agent ! ") ;(" MS Agent Microsoft

    http://www.microsoft.com/msagent/");;

    ;

    // BaiioonDiaiogBalloon = ("BlnDialogT.Balloon");// Balloon.ResetProperties();

    ("BaiioonDiaiog !");(" BaiioonDiaiog SommyTech

    http://www.sonmytech.com.ar");;

    ;

    Agent.Connected = ; // Agent.Characters.Load("Merlin", "Merlin.acs"); // Characters = Agent.Characters("Merlin"); // Characters.Show(); //

    // Balloon.MsgBalloon(" !",,"!", Characters);

    Balloon 8.0 "1:" - ("1011. Balloon"), 7.7 ("BinDialog. Balloon").

  • 38 7

    -, - "BinDialogT.Balloon", -

    .

    MsgBaiioon , - . , -

    .

    ; , - ; ; MS Agent. , -

    . ,

    Balloon . , 1.21, (. 1.7).

    ! 1

  • ActiveX 39

    MsgBaiioon . , ,

    . : -

    .

    , 36 (4+32) , Yes No ( 4) ( 32). , BaiioonDialog, .

    .

    1 Cancel.CJ 2 Abort, Retry Ignore. Yes, No Cancel. 4 Yes No. Retry Cancel. , BaiioonDialog . 16 . 32 . 4 8 . 64 . 80 ,

    IconPicture URLIconPicture.

    , MsgBaiioon , - .

    1 . 2 Cancel. Abort. 4 Retry. 5 Ignore. Yes. 7 No. "1:" - , ,

    . ,

    ButtonsCaptions. , - (. 1.8).

  • 40 1

    ! !

    . 1.8. BalloonDialog

    (- 1.22).

    // Balloon.ButtonsCaptions="&OK;&;&;&;&;&;&";

    // = Balloon.MsgBalloon(" !", 35, "- !", Characters); = 6 (" !");

    = 1

    (" !"); = 2

    (" !");;

    // , Balloon. ButtonsCaptions='40K;0&TMeHa;n&pepBaTb; ;;&;&";

    & "" +

  • ActiveX 41

    "1:" BalloonDialog inputBalloon (. 1.9).

    .

    JQK___ j |

    . 1.9. BalloonDialog

    ( 1.23).

    // = Balloon.InputBalloon(" .", " "," ", Characters);// , Balloon.MsgBalloon(,, "!", Characters);

    inputBalloon . , , ,

    , .

    BalloonDialog - , ,

    , , , . -

    FormBalloon. , -

    ; - (. 1.10).

  • 42 1

    5

    \\

    . 1.10. BalloonDialog ,

    , -

    ,

    . -

    7.7 8.0, ( 1.24 1.25).

    1.24. BalloonDialog 7.7

    // Balloon.FormBalloon.Buttons.Add("&0");

    // = 1 (.() , 5) Balloon.FormBalloon.OptionButtons.Add(.() . -

    () ) ;;

    Balloon.FormBalloon.TextBox = 0; // Balloon.FormBalloon.TBoxLines = 3; //

  • ActiveX 43_

    // Balloon.FormBalloon.TBoxText = " ";

    Balloon.FormBalloon.Title = " "; // Balloon.FormBalloon.Message = " "; // // Balloon.FormBalloon.Comment = " 5 ";

    Balloon.FormBalloon.SepLine = 1; //

    // Balloon.ShowFormBalloon(Characters);

    // , Balloon.FormBalloon.ButtonPressed = 0 // = Balloon.FormBalloon.OptionPressed;// = .().;("." + ); //

    ;

    BalloonDialog

    // Balloon.FormBalloon.Buttons.Add("&OTMeHa");

    // = 1;

    .

    Balloon.FormBalloon.OptionButtons.Add(.()) = + 1;

    = 6 ;

    ;

    ;

    Balloon.FormBalloon.TextBox = ; // Balloon.FormBalloon.TBoxLines = 3; //

  • _44 . 1

    /I Balloon.FormBalloon.TBoxText = " ";

    Balloon.FormBalloon.Title = " "; // Balloon.FormBalloon.Message = " "; // Balloon.FormBalloon.Comment = " 5 ";// Balloon.FormBalloon.SepLine = ; //

    // Balloon.ShowFormBalloon(Characters);

    // , Balloon.FormBalloon.ButtonPressed = 0

    // = Balloon.FormBalloon.OptionPressed;// = .[1].;// = [].();.(); //

    ;

    -

    . .

    Buttons.Add FormBalloon . - optionButtons. Add . ShowFormBalloon . -

    MS Agent. "1C:" ButtonPressed, : ;

    1 -.

    OptionPressed. , . .

    .

  • ActiveX 45

    , .

    Balloon Font: Balloon.Font.Bold ; Balloon. Font.charset ; Balloon.Font.italic ; Balloon. Font.Name ;

    Balloon.Font.size ; Balloon.Font.strikethrough ; Balloon.Font.underline .

    HTML- HTML- ActiveX- Microsoft InternetExplorer. "1C: 7.7" ActiveX, , , ,

    , 8.0. . 1.11 HTML-, "1C: 8.0".

    ii HTML Editor 1.0 e MAV

    J? trl

  • 46_ 1

    ,

    ,

    .

    ,

    .

    , HTML-.

    .

    Open ( ) write writeLn; Close ( ) ; write (Text) HTML- ; writeLn (Text) write,

    ;

    ExecCommand (Command, Userlnterface, Value) , -

    :

    Command , ;

    Userlnterface , - ( );

    value ( ); QueryCommandEnabied (Command) , -

    , ;

    QueryCommandValue (command) ;

    ElementFromPoint (x, Y) , , ;

    QueryCommandSupported (Command) , ;

    QueryCommandstate (Command) ; QueryCommandlndetermtCommand) ,

    ;

    createEiement (Tag) ; HTML- (- 1.26).

  • ActiveX 47

    = ..;

    .Open();. WriteLn("IIpHMep HTML ");.Write(" ");.Close();

    HTML-, .

    ExecCommand(Command, Userlnterf , V a l u e ) . , - , command , Userinterface - ( ), ( ). , , value , .

    , ExecCommand -.

    : -

    ( );; ; ; , - ( 1.27).

    // .execCommandC'ForeColor", , "FFOOOO");// .execCommand("Bold", };// .execCommand("Insertlmage", , "C:\Img\mav.jpg");// .execCommandC'JustifyRight", );// Arial.execCommand("FontName", , "Arial");// .execCommand("FormatBlock", , "");

  • 48 1

    .

    Backcoior (value RGB, , FFCCOO);

    Bold - ;

    ;

    createBookmark - (value , );

    CreateLink URL- (- value URL);

    cut ;

    Delete ( ); Find , value ; FontName , value

    ( ); Fontsize (value 1 7

    ); ForeCoior , Value -

    RGB- (,FFCCOO);

    FormatBiock (value -);

    indent -;

    InsertButton (value , );

    insertFieidset ; insertHorizontaiRuie ; insertiFrame (IFRAME); insertimage ; insertinputButton ; InsertlnputCheckbox (checkBox); insertinputFiieUpioad ; insertinputHidden (hidden); insertinputimage ;

  • ActiveX 49

    insertinputPassword ; insertinputRadio (Radio); insertinputReset Reset; insertinputsubmit submit; insertinputText ; insertParagraph (); insertorderedList -

    ;

    insertunorderedList ;

    insertseiectoropdown Drop-down - (value );

    InsertTextArea TextArea;

    italic - ;

    Justifycenter , ;

    just i fyLeft , ;

    justifyRight , ;

    outdent , , ;

    overwrite ( value , );

    Paste ; Refresh ; Remove Format -

    ;

    SeiectAil ; unBookmark ; underline

    ;

    unlink ; unselect .

  • 50 1

    -

    HTML- , .

    HTML-, . 1.28 , .

    -~"";-------------- ..-..,-..,.-..,- ..,| 1.28. (, , ) = ""

    .Body.InnerText = .Body.InnerHTML;

    = ""

    .Body.InnerHTML = .Body.InnerText;

    ;

    = ""

    .Body.ContentEditable = "false";

    .Body.ContentEditable = "true";;

    :

    ;

    ,

    ,

    ;

    , .

    , 1.29, - HTML- - ,

    ,

    . -

    , , -

    Internet Explorer. -

    (. 1.12) HTML ( 1.29).

  • ActiveX 51

    HTML Editoi 1.0 *MAV _ D X

    I ol '& :, . '., %, :_S = V

    riepeHTn >>

    , ' - .

    < INPUTmaxLength=100 value="Bam e-mail" => < INPUT tvpe=hidden value = list . soft. name=src;

    . 1.12. HTML-

    (, , ) = ""

    sExpression = "I document.body.innerText = document.body.innerHTML;|document.body.innerHTML = colourCode(document.body.innerHTML);I function colourCode(code)|{| htmlTag = /(sit;([\s\S]*?)sgt;)/gi| tableTag = /()/gi| imageTag = /()/giI linkTag = / (sit;(a|\/a) ([\s\S]*?)>)/gi| scriptTag = / (< (script I\/script) ([\s\S]*?)>)/giI code = code.replace(htmlTag,""$K/font>"")| code = code.replace(tableTag,""$K/font>"")

  • 52 1

    I code = code.replace(commentTag,""$K/font>"")

    I code = code.replace(imageTag,""$K/font>"")I code = code.replace(linkTag,""$K/font>"")I code = code.replace(scriptTag,""$K/font>"")I return code;

    IP;

    .parentWindow.execScript(sExpression);

    = ""

    .Body.InnerHTML = .Body.InnerText;

    ;

    = ""

    .Body.ContentEditable = "false";

    .Body.ContentEditable = "true";

    ;

    .

    , , -

    , . .

    , Perl, JavaScript, Visual Basic. , "1:" , -

    -.

    Microsoft WindowsScript Technologies VBScript. - vbscript.dll. - Internet Explorer 4 . , -

    , .

    (metacharacters) . - . -

    . 1.1.

  • ActiveX 53

    1.1.

    , "*",

    . , " [0-9] *" -,

    \ , ., "." , "\." -

    $+

    , "+",

    . , " [ 0 - 9 ] + " , -

    . () , I . , " |" -

    "" ""

    [a-z] . , " [0-9]"

    [ ] , . -, " [ 0-9]" ,

    \w . , [a-zA-z_0-9]\w , . , [Aa-zA-z_0-9]\s \s \d . , [0-9]\D He . , [ 0-9]{ } ,

    ()

    .

    " ( | ) " , - " ", " ".

    " . + @ . + \ . . + " e-mail-.

  • 54 1

    " ( . ) \1" "", - , "". ,

    "", "".

    CJ " ( \ d \ d ) \. \ 1 \ . \ d \ d \ d \ d " , , " 0 9 . 0 9 . 2 0 0 1 " - , "09.12.2001" .

    " \ d { 2 } - \ d { 5 } " -, , , .

    ". *'.' HTML.

    - VBScript.RegExp. RegExp :

    Global , , ,

    ;

    ignorecase ( ) ;

    Pattern ;

    MultiLine , (- ) .

    RegExp. Test () Test

    (pattern). - , , ,

    , .

    Execute () -

    MatchCoiiection, -. Execute , , - e-mail- .

    Replace(, ) Replace - -

    .

    1.30 Execute MatchCoiiection.

  • ActiveX 55

    // () = "3To " , . . , " ( * ) " ( SubMatches ( i ) . .);

    " " ( value) .

    , -

  • 56 1

    " (# [0-9A-F] { 6 } ) ". SubMatches ( 0 ) "#FFAABB", .

    Test. 1.31 .

    .31.

    // () = " ( # [ - 9 A - F ] { } ) ";// = "3ro ";

    // RegExp = ("VBScript.RegExp");RegExp.MultiLine = ;RegExp.Global = ;RegExp.IgnoreCase = ;RegExp.Pattern = ;

    // RegExp.Test()

    (" !");

    (" ! " ) ;;

    "1: 8.0". 7.7 Test -1 .

    Replace , - 1.32, , , .

    // = "3ro ";//

  • ActiveX _ 57

    RegExp. Pattern = " ( . *?) ";// = RegExp. Replace (, "

    // (" :" + . + );

    Replace " P! ". . -

    .

  • 2

    Windows WMI

    WMI Microsoft,

    , Windows, Windows ManagementInstrumentation (WMI). WMI , "1:". , Windows Xp Server 2003 - WMI ( WMI Command line, WMIC). WMI - -

    , , -

    (, - , -

    . .)., Windows NT - .

    , -

    ( SAM, Event Log, . .), - ( User Manager, - Event Log Viewer, Regedit) (Network API , EventLog API , RegistryAPI ). , , . ., -, -

    , -,

  • 60 2

    (, - , ). Windows 2000 .

    (Microsoft Management Console), - -

    , Windows. , WMI. - , -, -

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

    ,

    , .

    , WMI , -

    . , WMI, Windows Script Host (WSH) . Windows. -

    WMI -, (Event Logs), , , -

    ,

    , . .

    , -

    , .

    . WMI - (DNS, DHCP . .) , SNMP (Simple NetworkManagement Protocol).

    . -

    WMI, ,

    . , -

    -

    , , -

    . .

    Windows. WMI Microsoft: Application Center,Operations Manager, Systems Management Server, Internet Information Server,Exchange Server, SQL Server.

  • Windows WMI 61

    WMI WMI , - WMI. , - ,

    .

    swbemLocator swbemServices, WMI. - .

    swbemServices -, WMI, WMI .

    swbemobjectset swbemobject. swbemobjectset - , swbemServices SWbemObject.

    swbemobject WMI .

    ,

    Microsoft Developer Network Library (MSDN) http://msdn.microsoft.com/library/. WMI WMI "1 (^" , WMI. - Windows Management Service, - WMI, - . ,

    , -

    .

    , -

    "1C: "(7.7 8.0). 7.7 , -

    .

    WM1 "1:" 8.0 - ,

    .

    win32_Logicaioisk ( 2.1).

  • 62 2

    // SWbemLocator

    Locator = ("WbemScripting.SWbemLocator");

    (());;

    ;

    // 1. WMI ServicesSet = Locator.ConnectServer(".");

    // 2. Win32_LogicalDiskObjectSet = ServicesSet.InstancesOf("Win32_LogicalDisk");

    // . SWbemObjectSet, Item ObjectSet

    (": " + Item.Caption);;

    -

    , .

    , .

    ( 2.2).

    // 1. WMI ServicesSet = Locator.ConnectServer("MainServer", "root\cimv2", "Admin","password");

    ConnectServer . ( -

    "."). WMI. root\cimv2 -

    ;

    ( ). ( ).

  • Windows WMI 63

    -

    (Getobject Visual Basic Visual Basic Script). 2.3.

    ! 2.3. 8.0

    = ".";

    // 1. WMI ServicesSet =("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");

    // 2. Win32_LogicalDiskObjectSet = ServicesSet.ExecQuery("Select * from Win32_LogicalDisk");

    // . SWbemObjectSet, Item ObjectSet (": " + Item.Caption);

    ;

    WMI - win32_Logicaioisk WMI- (moniker) winmgmts. -, -

    . WMI- , -

    .

    win32_LogicaiDisk swbemobject SWbemObjectSet. SWbemObjectSet SWbemObject , WMI. SWbemObjectSet , - .........

    caption, Win32_LogicalDisk.

    ,

    ,

    (SQL). -, , . .

    .

  • 64 2

    ,

    (HDD) CD-ROM, FDD . . ( 2.4).

    2.4. 8.

    // 2. Win32_LogicalDiskObjectSet = ServicesSet.ExecQuery("Select * from Win32__LogicalDisk WhereDriveType=3");

    // . SWbemObjectSet,' Item ObjectSet

    (": " + Item.Caption) ;;

    (oriveType), , - . -

    .

    swbemLocator , -

    , WMI. , ,

    SWbemLocator. ConnectServer, swbemLocator, , WMI-. -

    .

    ,

    "1:" 7.7.

    , 7.7 -:

    , 7.7 , .........;

    , WMI-, 7.7 .

    , -,

    -,

    . (, , ) -, 7.7 -.

  • Windows WMI 65

    (- 2.5): ; ;

    , 8.0.

    I 2.5. -

    ' ObjSet NumberPublic Function EnumerateCollection(ObjSet, Number)

    Dim Current As IntegerCurrent = 0 .For Each Obj In Ob j Set

    If Current = Number ThenSet EnumerateCollection = ObjExit Function

    End If

    Current = Current + 1

    Next

    End Function .

    ' ObjSetPublic Function GetCountCollection(ObjSet)

    Dim Current As IntegerCurrent = 0For Each Obj In ObjSet

    Current = Current + 1

    Next

    GetCountCollection = CurrentEnd Function

    ' -

    Public Function GetCOMObject(Str)Set GetCOMObject = GetObject(Str)

    End Function

    -,

    Visual Basic. COMServices.dll, - coMServices. COM.

    3 . 722

  • 66 2

    COMServices.dll , regsvr32 COMServices.dll. , WMI 7.7 - COMServices ( 2.6).

    WMI 8.0

    // COMServices

    COMServices = ("COMServices.COM");

    (" - COMServices.");;

    ;

    // SWbemLocator

    Locator = ("WbemScripting.SWbemLocator");

    (());;

    ;

    // 1. WMI ServicesSet = Locator.ConnectServer(".");

    // 2. Win32_LogicalDiskObjectSet = ServicesSet.InstancesOf("Win32_LogicalDisk") ;

    // . SWbemObjectSet, = 0 ObjectSet.Count-1

    Item = COMServices.EnumerateCollection(ObjectSet, );(": " + Item.Caption);

    ;

    .........

    ( count) . EnumerateCollection COMServices,

  • Windows WMI 67

    objectset - .

    8.0. , Count. , - GetcountCoiiection COMServices. WMI - 7.7 ( 2.7). ,.., , ,

    2.7. 7.7

    // , = ".";

    // 1. WMI ServicesSet = COMServices.GetCOMObject("winmgmts:{impersonationLevel=impersonate}!\\" + +"\root\cimv2");

    // 2. Win32_LogicalDiskObjectSet = ServicesSet.ExecQuery("Select * from Win32_LogicalDisk");

    // . SWbemObjectSet, = 0 ObjectSet.Count-1

    Item = COMServices.EnumerateCollectiori(ObjectSet, );(": " + Item.Caption);

    ;

    , -

    GetCOMObject swbemServices.

    WMI. - 8.0 "1:". 7.7 .

    2.1 . win32_LogicaiDisk , , -

  • 68 2

    , . . 2.8 - win32_Logicaioisk.

    // SWbemLocator

    Locator = ("WbemScripting.SWbemLocator");

    ((}};;

    ;

    // 1. WMI ServicesSet = Locator.ConnectServer(".");

    // 2. Win32_LogicalDiskObjectSet = ServicesSet.InstancesOf("Win32_LogicalDisk");

    // . SWbemObjectSet, Item ObjectSet (": " + Item.Caption);(": " + Item.Description);(" : " + Item.FileSystem);(" : " + Item.FreeSpace);(" : " + Item.VolumeName); ("=======================") ;

    ;

    win32_LogicaiDisk ( 2.9).

    | 2.9. win32_LogicL.._ ; ' , __ . , _7__.'

    // 3. SWbemObjectSet, Item ObjectSet (": " + Item.Caption);// Item.Properties_

  • Windows WMI 69

    (.Name + " = " + .Value);;

    ;

    ,

    , .

    win32_Logicaioisk , - -

    . :

    ) win32_Processor ; win32_BaseBoard ; win32_DiskDrive (HDD); win32_physicaiMemory (RAM); win32_SoundDevice ; win32_NetworkAdapter ; win32_CDROMDrive CD-ROM; win32_FioppyDrive (Floppy);G win32_DesktopMonitor ; win32_videocontroiier ; win32_printer ; win32_Keyboard ; win32_PointingDevice (-

    , . .); win32_usBHub USB.

    win32_Product. ,

    , -

    Microsoft Windows Installer (MSI). win32_Product: Name ; Description ; identifyingNumber (

    );

  • 70 2

    instaiioate ; instaliLocation ; vendor ; version . win32_Product: Install(PackageLocation, Options, Al lUsers) ,

    :

    PackageLocation ;

    Options ; Aiiusers ;

    Reinstall (ReinstaiiMode) : ReinstaiiMode ( i -

    , ). uninstaiio .

    , .

    2 1 4 7 5 4 9 4 4 5 .

    , win32_Product, 2.10.

    2.10.

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_Product"); Item Items

    (": " + Item.Name + " (." + Item.Version + ")");;

    - , where. Microsoft, ( 2.11).

  • Windows WMI 71,.... .-,,--. -. 'i| 2.11. MicrosoftServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_Product Where VendorLIKE '%Microsoft%'"); Item Items

    (": " + Item.Name + " (." + Item.Version + ")");;

    "%Microsoft%". -, , vendor - "Microsoft".

    -

    uninstaii win32_product. Adobe Acrobat 6.0 Professional ( 2.12).

    = "Adobe Acrobat 6.0 Professional"; (" , " + + "?",.) = . ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_Product Where Name =

    '" + + "'"); Item Items

    Item.Uninstaii();;

    ;

    () WMI win32_service. . - :

    Accept Pause ; Acceptstop ;

  • 72_ 2

    Name ; Description ; DisplayName , ; PathName ;

    Process id ; started , , ; State , (stopped, Start Pending,

    Stop Pending, Running, Continue Pending, Pause Pending, Paused, Unknown). win32_service: startservice ( ) ; stopserviceo ; PauseService ( ) ; ResumeService ( ) ; Delete ( ) ; create (...) ( , -

    ). WMI Win32_process. - :

    Description ; Process id ; Name ; Priority ( 0 37); virtuaisize , . win32_Process: setPriority (Priority) , -

    Priority : 64 Idle (, ); 16384 Below Normal ( ); 32 Normal (); 32768 Above Normal ( ); 128 High Priority ( ); 256 Realtime ( , -

    ). Terminate .

  • Windows WMI 73

    Win32_Service ( 2.13).

    ServicesSet =("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_Service"); Item Items (": " + Item.DisplayName + " (" + Item.State + ")");

    ;

    , , -

    win32_service. , Acceptstop True (). 2.14.

    ServicesSet =("winmgmts:{impersonationLevel=impersonate}! \\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_Service WhereAcceptstop = True"); Item Items (" : " + Item.DisplayName);

    ;

    ( 2.15) - Notepad.exe ().

    2.15.

    ABOVE_NORMAL = 32768;ServicesSet =("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_Process Where Name =

  • _74 2

    'Notepad.exe'") ; Item Items

    Item.SetPriority(ABOVE_NORMAL);;

    Terminate ( 2.16).

    ServicesSet = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_Process Where Name ='Notepad.exe'"); Item Items

    Item.Terminate();;

    startservice ( 2.17). stopservice. -.

    2.17.

    ServicesSet = ("winmgmts:(impersonationLevel=impersonate)!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_Service Where Name='Alerter'"); // Item Items

    Item.StartService(); // ;

    ExecQuery Alerter (). , , -

    StartService.

  • Windows WMI 75

    WMI , Win32_OperatingSystem. - :

    Name ; BootDevice , -

    ;

    SystemDrive , -;

    windowsDirectory , ; Description ; FreePhysicaiMemory ( ); FreeVirtuaiMemory ( ); Manufacturer .

    "Microsoft Corporation"; NumberOfProcesses ; organization ,

    ;

    RegisteredUser , - ;

    SeriaiNumber ; osbanguage . ,

    0419 . .; . , WIN98, 18

    WINNT, - SunOS . .; Primary ; version ; BuiidNumber ; Win32_OperatingSystem:

    Reboot ( ) ; shutdown ( ) ; win32shutdown(Fiag)

    (\32- ). Flag - :

    (Log Off);

  • 76 2

    4 (Forced Log Off); i (Shutdown); 5 (Forced Shutdown); 2 (Reboot); 6 (Forced Reboot); 8 (Power Of!); 12 (Forced Power Off).

    . -

    , 2.18, ,

    ( ).

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_OperatingSystem"); Item Items (": " + Item.Caption);(": " + Item.WindowsDirectory);(": " + Item.Version);

    ;

    Win32Shutdown ( 2.19).

    i 2.19.

    ServicesSet=nony4HTbCOM06beKT("winmgmts:{impersonationLevel=impersonate,(Shutdown)}!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_OperatingSystem"); Item Items Item.Win32Shutdown(5); //

    ;

  • Windows WMI 77

    ScreenWidth() ScreenHeight () Win32_DesktopMonitor (- 2.20).

    ServicesSet = Locator.ConnectServer(, "root\cimv2"., );Items = ServicesSet.ExecQuery("Select * from Win32_DesktopMonitor"); Item Items

    (": " + Item.ScreenWidth + " x " + Item.ScreenHeight);;

    , -

    Windows, win32_startupcommand( 2.21).

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_StartupCommand"); Item Items

    (": " + Itern.Command);(": " + Item.Description);(": " + Item.Location);(": " + Item.Name);(": " + Item.User);

    ;

    Windows XP/Server 2003 Windows XP Windows Server 2003 ActivateOnline ( ) Win32_WindowsProductActivation( 2.22).

  • 78 2

    ServicesSet = Locator.ConnectServer(, "root\cimv2', );Items = ServicesSet.ExecQuery("Select * fromWin32_WindowsProductActivation"); Item Items Item.ActivateOnline();

    ;

    -

    :

    win32_ComputerSystem ; win32_Group ; win32_Account . win32_ComputerSystem: Description ; Domain , ; DomainRole ; inf raredSupported ; Manufacturer ; Model ; NumberOfProcessors ; userName , ; workgroup . Win32_ComputerSystem Rename (), .

    , .

    win32_Group win32_Account , .

    , , -

    Domain Win32_ComputerSystem ( 2.23).

  • Windows WMI 79

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Computers = ServicesSet.ExecQuery("Select * from Win32_ComputerSystem"); Computer Computers (": " + Computer.Name);(": " + Computer.Domain);

    ;

    DNSDomain Win32_NetworkAdapterConfiguration.

    , . .

    , DomainRoie win32_computersystem. - :

    (Standalone Workstation); 1 (Member Workstation); 2 (Standalone Server); , . . , -

    (Member Server); 4 , . . Windows

    NT, , ,

    (Backup Domain Controller); 5 , . . , -

    ,

    , -,

    - (Primary Domain Controller). 2.24.

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Computers = ServicesSet.ExecQuery("Select * from Win32_ComputerSystem"); Computer Computers

  • 80 2

    = ();.("Standalone Workstation");.("Member Workstationn");.("Standalone Server");.("Member Server");.("Backup Domain Controller");.("Primary Domain Controller");

    (" : " + [Computer.DomainRole]);;

    ,

    , UserName Win32_ComputerSystem( 2.25).

    j 2.25.

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Computers = ServicesSet.ExecQuery("Select * from Win32_ComputerSystem"); Computer Computers (": " + Computer.UserName);

    ;

    Win32_Group , LocalAccount True (). 2.26.

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQueryt"Select * from Win32_GroupWhere LocalAccount = True"); Item Items

    (" : " + Item.LocalAccount);

  • Windows WMI 81

    (" : " + Item.Name) ;(": " + Item.SID);(": " + Itera.SIDType);(": " + Item.Status);

    ;

    win32_Account. , - :

    1 ; 2 ; ;

    4 ; 5 ; ;

    7 ; 8 ; 9 . ( 2.27).

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.InstancesOf("Win32_Account");

    Item Items Item.SIDType = 1 (": " + Item.Caption);

    (Item.SIDType = 2) (Item.SIDType = 4) (Item.SIDType = 5)

    (": " + Item.Caption);;

    ;

    ,

    .

  • 82_ 2

    WMI win32_LocaiTime. , . . .

    , -

    win32_LocaiTime ( 2.28).

    ! 2.28. ( '^ _^_ _. ^ ^^ ^ iL ___ - . :_i.: .:_*_

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQueryf"Select * from Win32_LocalTime"); Item Items

    (": " + Item.Day);(": " + Item.Month);(": " + Item.Year);(": " + Item. Hour);(": " + Item.Minute);(": " + Item.Second);

    ;

    , , -

    win32_TimeZone ( 2.29). : , -

    (DaylightName), (standardName), - .

    win32_TimeZone :

    DaylightName ; DayiightDayOfWeek (i , 2

    . ., 7 ); DaylightHour ; DaylightMinute ;

    DaylightSecond ;

  • Windows WMI 83

    CJ DaylightDay ;CD DaylightMonth ; DaylightYear . ,

    Daylight Standard.

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQueryf"Select * from Win32_TimeZone"); Item Items

    (" ( ): " + Item.DaylightNaine);(": " + Item.DaylightHour + ":" + Item.DaylightMinute +

    ":" + Item.DaylightSecond) ;(" ( ): " + Item.StandardName);(": " + Item.StandardHour + ":" + Item.StandardMinute +

    ":" + Item.StandardSecond);;

    WMI : win32_NTEventLogFiie ;CJ win32_NTLogEvent . win32_NTEventLogFiie : compressed ; compressionMethod ; Description ; Drive , ; Encrypted ; EncryptionMethod ; FiieName ; Fiiesize ; NumberOfRecords . win32_NTEventLogFiie : Copy (FiieName) ,

    FiieName;

  • 84 2

    Rename (FiieName) . FiieName;

    Delete ( ) ; compress () ; Uncompress ; ciearEventLog ( ) . win32_NTLogEvent , . . - -

    . 2.32.

    "System", - ( 2.30).

    " ~"7

    ~"

    1^"1!1^ ""~~~" : ~ " ^ ----.-

    - :

    ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_NTEventLogFile whereLogFileName='System"1) ; Item Items

    (" : " + Item.NumberOfRecords);(" : " + Item.MaxFileSize) ;(" : " + Item.Name);

    ;

    -

    LogFiieName ( ) 'system'.

    ,

    . ciearEventLog Win32_NTEventLogFile ( 2.31).

    I 2.31.

    ServicesSet = Locator.ConnectServer(, "root\cimv2"., );Items = ServicesSet.ExecQuery("Select * from Win32_NTEventLogFile where

  • Windows WMI 85

    LogFileName='Application'"); Item Items Item.Copy(":\application.evt"); // Item.ClearEventLogO; //

    ;

    win32_NTLogEvent. "System" ( 2.32).

    ServicesSet - Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from Win32_NTLogEvent whereLogfile='System"1 ); Item Items ("Category: " + Item.Category);("ComputerName: " + Item.ComputerName);("Message: " + Item.Message);("RecordNumber: " + Item.RecordNumber);("TimeWritten: " + Item.TimeWritten);("User: " + Item.User); (" ") ;

    ;

    ciM_DataFiie. :

    Name ; Path ; Archive ; system ; compressed ; Drive () ,

    ;

  • 86 2

    Extension ; FileSize ; EightDotThreeFiieName DOS- (, c:\progra~l). :

    Compress ; Copy(FileName) ( -

    FileName); Delete ; Rename (FileName) ( -

    FileName). 2.33 2.34 - .

    ReadMe.txt, c:\Program Files\lCv77 ( 2.33).

    | 2.33.

    ServicesSet = ("winmgmts:!\\" + +"\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Cim_Datafile where Name'c:\\Program Files\\lCv77\\ReadNe.txt '"); Item Items

    = Item.Rename(":\\Program Files\\lCv77\\ReadMe.bak");;

    , -

    ciM_DataFiie (Extension). 2.34.

    f _ _ _ _ . , . _ ____, . .,,.... ._.. _ _|| 2.34. ServicesSet = Locator.ConnectServer(, "root\cimv2",, );Items = ServicesSet.ExecQuery("Select * from CIM_DataFile where Extension= 'mp3'");

  • Windows WMI 87

    Item Items (" : " + Item.Name);

    ;

    WMI win32_share. Create, :

    Path ; Name ; ( , i , 2

    - ); imumAilowed ; Description . Delete . C:\Program Files - 2.35).

    i 2.35.

    FILE_SHARE = 0;MAXIMUM_CONNECTIONS = 25;ServicesSet =("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");NewShare = ServicesSet.Get("Win32_Share");

    = NewShare.Create(":\Program Files", "Share4You",FILE_SHARE, MAXIMUM_CONNECTIONS, " .");

    (". .");;

    win32_printer. :

    Name ; Comment ;

  • 88 2

    Default ; Description ; DriverName ; Local ; Network ; shared ; PortName ; Printerstatus (i , 2 -

    , , 4 , 5 , 6 ,7 ).

    win32_printer : AddPrinterConnection(Name) -

    Name; setDefauitPrinter () ; CancelAlUobs ; Pause ( ) ; Resume ( ) ; PrintTestPage ;CJ RenamePrinter (NewPrinterName) (

    NewPrinterName).

    "\\OfficeServer\MainOfficePrinter" ( 2.36).

    2.36.

    ServicesSet =("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");NewPrinter = ServicesSet.Get("Win32_Printer");

    = NewPrinter.AddPrinterConnection("\\OfficeServer\MainOfficePrinter");

    (". .");;

  • Windows WMI 89

    2.37. " """"" ."""---- ---- -

    i 2.37.

    = "MainOfficePrinter";ServicesSet = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");Printers = ServicesSet.Get("Win32_Printer");Items = ServicesSet.ExecQuery("Select * from Win32_Printer Where Name ='" + + "'");' Item Items

    Item.SetDefaultPrinter();;

    , , where - ( Name).

    win32_scheduledjob. -

    ( 2.38). win32_scheduiedJob . create . :

    Command , ; startTime UTC- (Universal Time

    Coordinated ),

    "YYYYMMDDHHMMSS.MMMMMM(+-)OOO", "YYYYMMDD" "******** (, "******** 123000.000000-420" 12:30 ;

    RunRepeatedly ; Daysofweek (1 , 2 , 4 ,

    8 , 16 , 32 , 64 ); DaysOfMonth ; interactwithDesktop ; Jobid .

    Delete () .

  • 90 2

    ( 2.38).

    ServicesSet = ("winmgmts:{impersonationLevel=impersonate)!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * from Win32_ScheduledJob"); Item Items

    (": " + Item.Caption);(": " + Item. Command) ;(" : " + Item.DaysOfMonth);(" : " + Item.DaysOfWeek);(": " + Item.Description);(": " + Item.ElapsedTime);(" : " + Item.InstallDate);(": " + Item.Name);(": " + Item.Notify);(": " + Item.Priority);(" : " + Item.StartTime);(": " + Item.Status);("============================");

    ;

    create. - "" (notepad.exe) 23:30 ( 2.39).

    ;

    ServicesSet = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");ObjectSet = ("WinMgmts:Win32_ScheduledJob");ObjectSet.Create("notepad.exe", "********123000.000000-420",True,1,2,True,);(" : " + );

  • Windows WMI 91

    stdRegProv, - root\default. , .

    CreateKey(DefKey, SubKeyName) . :

    DefKey , -:

    2147483648-HKEY_CLASSES_ROOT; 2147483649-HKEY_CURRENT_USER;

    2147483650 - HKEY_LOCAL_MACHINE; 2147483651- HKEYJJSERS; 2147483653- HKEY_CURRENT_CONFIG; 2147483654- HKEY_DYN_DATA;

    SubKeyName (). DeieteKey(DefKey, SubKeyName) .

    CreateKey.

    DeleteValue(DefKey, SubKeyName, ValueName) . DefKey SubKeyName create-, ValueName .

    GetDWORDValue(DefKey, SubKeyName, ValueName, Value) DWORD. DefKey, SubKeyName ValueName DeleteValue. value - ValueName.

    GetStringValue(DefKey, SubKeyName, ValueName, Value) .

    GetDWORDValue.

    GetExpandedStringValue(DefKey, SubKeyName, ValueName, Value) - .

    Getstringvaiue.

    SetDWORDValue(DefKey, SubKeyName, ValueName, V a l u e ) DWORD. value -, Getstringvaiue.

    SetStringValue(DefKey, SubKeyName, ValueName, Value) .

    SetDWORDValue.

  • 92 2

    SetExpandedStringValue(DefKey, SubKeyName, ValueName, Value) . -

    setowoRovaiue.

    GetstringValue,GetExpandedStringValue GetstringValue, .

    "HistoryBuf fersize", HKEY_CURRENT_USER\ Console ( 2.40).

    ;

    HKEY_CURRENTJJSER = 2147483649;

    = "Console";

    = "HistoryBufferSize";

    Reg = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\default:StdRegProv");Reg.GetDWORDValue(HKEY_CURRENT_USER, , , );(": " + );

    StdRegProv( 2.41).

    HKEY_LOCAL_MACHINE = 2147483650;

    Reg = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\default:StdRegProv"); = "SOFTWARE\NewKey";Reg.CreateKey(HKEY_LOCAL_MACHINE, );

    HKEY_LOCAL_MACHINE\SOFTWARE\ NewKey.

  • Windows WMI 93

    ( 2.42). " "

    "http://forum.erpg.ru" HKEY_LOCAL_MACHINE\ SOFTWARE\NewKey.

    |HKEY_LOCAL_MACHINE = 2147483650; = "SOFTWARE\NewKey";Reg = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\default:StdRegProv"); = " ";

    = "http://forum.erpg.ru";Reg.SetExpandedStringValue(HKEY_LOCAL_MACHINE, , ,);

    WMI :Win32_NetworkAdapterConfiguration Win32_NetworkAdapter. , . . .

    .

    .

    (DHCP,Dynamic Host Configuration Protocol), ReleaseDHCPLease Win32_NetworkAdapterConfiguration( 2.43). , WMI, . RenewDHCPLease.

    4

    ServicesSet = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\ci_mv2");Items = ServicesSet.ExecQuery("Select * FromWin32_NetworkAdapterConfiguration Where IPEnabled = True"); Item Items

    Item.ReleaseDHCPLease();;

  • 94 ^ 2

    MAC- IP- IP'^aflpeca, -, -,

    Win32_NetworkAdapter. , Win32_NetworkAdapterConfiguration, IP-, -. 2.44.

    2.44. MAC- IP-

    MACAddress = "";

    ServicesSet = ("winmgmts:{impersonationLevel=impersonate}!\\" + + "\root\cimv2");Items = ServicesSet.ExecQuery("Select * From Win32_NetworkAdapter"); Item Items

    MACAddress = Item.MACAddress;

    ;

    MACAddress ""

    ("MAC : " + MACAddress);

    Items = ServicesSet.ExecQuery("Select * FromWin32_NetworkAdapterConfiguration"); Item Items

    Item.MACAddress = MACAddress

    IPAddress Item.IPAddress

    ("IP : " + IPAddress);;

    ;

    ;

    ;

    Ping -

    ping.exe. WMI statusCode Win32_PingStatus ( 2.45). Address, , (Hostname), IP-.

  • Windows WMI 95

    Ping

    //IPAddress = "172.20.129.102"; // IP-IPAddress = "MAVCOMP"; // Hostname

    ServicesSet = ("winmgmts:\\" + +"\root\cimv2");Items = ServicesSet.ExecQuery("Select * From Win32_PingStatuswhere Address = '" + IPAddress + "'");

    Item Items (Item.StatusCode = NULL) (Item. StatusCode 0) (" .");

    (" .");;

    ;

  • 3

    WSH

    WSHWindows Script Host (WSH) Windows, ,

    , . -

    WSH/ , , Windows, - ,

    . , WSH - (-), .

    ^

    WSH Microsoft Windows 98/ME/NT/2000/XP/Server 2003. Windows 95 Windows Script Host Microsoft http://msdn.microsoft.com/scripting.

    WSH , -

    , . Windows Script Host .

    wscript WSH, WSH -, , . .

    , -

    "1:", .

    4 . 722

  • 98 3

    WshArguments, WshNamed WshUnnamed , - Windows. -

    ,

    .

    wshshell , , , ,

    Windows. wshSpeciaiFolders ,

    Windows. wshshortout ,

    Windows. wshurishortout , -

    .

    wshEnvironment , ( , ).

    wshNetwork , . ,

    .

    wshScriptExec , - . -

    .

    wshController , - .

    wshRemote , , .

    wshRemoteError , , ,

    .

    CJ FileSystemObject , .

    VB- (VBS) VB-, (bat). "1,:". , -

    , .

  • WSH

    - Msscriptcontroi, "". Msscriptcontroi WSH, "" . VB- - "1:" ( 3.1).

    // = "Function VBSFunction(}I GetDefaultPrinter = vbNullStringI Set objWMIService = GetObject(""winmgmts:"" & ""{impersonationLevel=impersonate}!\\.\root\cimv2"")I Set colInstalledPrinters = objWMIService.ExecQuery(""Select * fromWin32_Printer"")I For Each objPrinter in colInstalledPrintersI If objPrinter.Attributes and 4 ThenI VBSFunction=obj Printer.NameI Exit ForI End IfI Next

    I End Function";

    // scrptCtrl = ("MSScriptControl.ScriptControl");scrptCtrl.Language="vbscript"; // // scrptctrl.Addcode(..());// (scrptCtrl.run("VBSFunction"));

    , . . .

    , , -

    .

    VB-, , run Msscriptcontroi.ScriptControl .

    7.7 , -.

  • 100 3

    WSH FileSystemObject. :

    ;

    ;

    ;

    ;

    Drive, Folder File -, .

    Drive, Folder File - , -

    . Folder File - (, , ,); FileSystemObject. , -: Drives, Folders Files. - Drives Drive -, Folders Folder ,Files File , .

    , -

    . Textstream. FileSystemObject "". -

    .

    Drive. , , . .

    Drive GetDrive FileSystemObject. ( 3.2).

  • WSH 101

    // = ();.("");.("");.("");.("");.("CD-ROM");.("RAM-");

    // FileSystemObjectFS = ("Scripting.FileSystemObject");//

    Drive = FSO.GetDriveC'C") ;

    // (" :");(" : " + Drive.VolumeName);(" : " + Drive.TotalSize/1024 + " '(": " + Drive.FreeSpace/1024 + " ");(" : " + Drive.DriveLetter);(": " + [Drive.DriveType]);(" : " + Drive.FileSystem);(" : " + Drive.IsReady);(": " + Drive.Path);(" : " + Drive.RootFolder);(" : " + Drive.SerialNumber);(" : " + Drive.ShareName);

    // Drive.VolumeName = "www.erpg.ru";

    VolumeName , , . .

    .

  • 102 3

    Folder.File. , , . . -

    GetFolder GetFile FileSystemObject. ( 3.3).

    // File.// (File)Attr = (File.Attributes, 2);// 10 // , - .

    Attr = 0 "";

    ;-

    = "";

    ((Attr,(Attr}-4,1) = "1") ((Attr) > 4) = + " " ;

    ((Attr,(Attr),1) = "1") ((Attr) > 0) = + " " ;

    ((Attr,(Attr)-!,!) = "1") ((Attr) > 1) = + " " ;

    ((Attr,(Attr)-2,1) = "1") ((Attr) > 2) = + " " ;

    ((Attr,(Attr)-3,1) = "1") ((Attr) > 3) = + " " ;

    ((Attr,(Attr)-5,1) = "1") ((Attr) > 5) = + " " ;

    ((Attr,(Attr)-10,1) = "1") ((Attr) > 10) = + " " ;

    ((Attr,(Attr)-11,1) = "1") ((Attr) > 11) = + " " ;

  • WSH 103

    ;

    // .// FileSystemObjectFSO = ("Scripting.FileSystemObject");

    // Folder = FSO.GetFolder (": \Program FilesV) ;

    // (" c:\Program FilesV1);(": " + (Folder));(" : " + Folder.DateCreated);(" : " + Folder.DateLastAccessed);(" : " + Folder.DateLastModifled);(" : " + Folder.IsRootFolder);(": " + Folder.Name); //!!(" : " + Folder.ParentFolder);(": " + Folder.Path);(" : " + Folder.ShortName);(" : " + Folder.ShortPath);(": " + Folder.Size);(" : " + Folder.SubFolders);(": " + Folder.Type);

    File .

    ^

    Name , . . .

    SubFolders, - .

    Folders, Folder. "1:" 8.0 .......... 7.7 - ( - 2).

  • 104 3

    ,

    ,

    DriveExists, FoiderExists FileExists FileSystemObject. ( 7.7 -1), , , ,

    ( 7.7 0). -

    , , , -

    .

    ( 3.4).

    : 3.4.

    = "c:\Program Files\lcv8\bin\lcv8.exe";FSO = ("Scripting.FileSystemObject"); FSO.FileExists() (" !");

    (" !");;

    copyFile CopyFolder FileSystemOb]ect, File.Copy Folder.Copy. ( 3.5).

    3.5. 0 // .Paragraphs.Add(); = .Paragraphs.Count();.Paragraphs(-1}.Range(). InsertAfter( .);.Paragraphs().Range().Style="3aooo 1";

    // [.]

    // .Paragraphs.Add(); = .Paragraphs.Count() ;.Paragraphs(-1).Range().InsertAfter(.);.Paragraphs().Range().Style="aooo 2";

    //

    = [.].();

    ;

    ;

    > 0

    // .Paragraphs.Add(); = .Paragraphs.Count();.Paragraphs(-1).Range().InsertAfter(. + " (" + + ")");.Paragraphs().Range().Style="3aooo 3";

    // .Paragraphs.Add();=.Paragraphs.Count();//

  • 158 4

    .Tables.Add(. Paragraphs().Range ,+1,4);

    = 1;// = .Tables(.Tables.Count());.Cell(,1).Ranged.InsertAfter("");.Cell(,2).Range .InsertAfter("");.Cell(,3) .Range .InsertAfter("");.Cell(,4).Ranged.InsertAfter("");// .Range( .Cell( ,!). Range.Start,.Cell(,4).Range.End).Font.Bold = ;

    [.] = + 1;

    //

    .Cell(,1).Range().InsertAfter(.);

    ;

    .Cell( ,2).Range().InsertAfter( .);

    ;

    = "";

    // ..() = + " " + ();

    ;

    .Cell(,3).Ranged.InsertAfter();

    ;

    .Cell( ,4).Range ().InsertAfter( .);

    ;

  • OLE Automation 159

    ;

    ;

    ;

    ;

    ;

    ;

    // Word.Visible = ;

    // Word.Activate();Word = ;

    Tables, . Add .

    :

    1. , .2. .3. . , -

    , Tables - , cell , .

    , . . -

    , . 7.7 "1:" . , word.Application - .

    MS Word Word.Application Excel.Application - MS Word Excel OLE-. ,

    VB-. MS Word 2002 ( - ) ;

  • 160 4

    Visual BasicProject. MS Word OLE- ( 4.30).

    MS Word

    // VBA = "Sub VBAFunction()I Selection.TypeText Text:="" , !""I Selection.TypeParagraphI Selection.TypeText Text:="" ""I Application.Keyboard (1033)I Selection.TypeText Text:="": http://forum.erpg.ru""I Selection.TypeParagraphI Selection.MoveUp Unit:=wdLine, Count:=2iSelection.EndKey Unit:=wdLine, Extend:=wdExtendI Selection.Style = ActiveDocument.Styles("" 1"")I Selection.MoveDown Unit:=wdLine, Count:=lI Selection.HomeKey Unit:=wdLineI Selection.EndKey Unit:=wdLine, Extend:=wdExtendI Selection.Style = ActiveDocument.Styles("" 2"")IActiveDocument.SaveAs FileName:=""C:/Example.doc"", FileFormat:=I wdForraatDocument, LockComments:=False, Passwords"""",I AddToRecentFiles:=I True, WritePassword:="""", ReadOnlyRecommended:=False,I EmbedTrueTypeFonts:=

    I False, SaveNativePictureForroat:=False, SaveFormsData:=False,I SaveAsAOCELetter:=FalseI End Sub";

    // Word = ("Word.Application");// Word.Documents.Add();// VB-VBComponents = Word. ActiveDocument.VBProj ect.VBComponents;// Count = VBComponents.Count();

  • OLE Automation 161

    VBComponents.Add(1);VBComponents.Item(Count + 1).CodeModule.InsertLines(1, );// VBAFunctionWord.Application.Run("VBAFunction");// OLE-Word.Quit();// Word = ;

    VBAFunction OLE-. VBAFunction MS Word, , Example.doc, - :.

    MS Word ,

    . , -

    Microsoft Word .

    "1:" , .

    OLE- Word. Application checkSpeiiing. -, , -

    . ,

    , , .

    CheckSpeiiing ( 4.31).

    I 4.31.

    = ("Word.Application"); // MS Word

    ("Microsoft Word !",,"!"); ;

    ;

    //

    6 . 722

  • 162 4

    = .CheckSpelling() ;

    (" !");

    (" !");;

    ,

    , ,

    .

    MS Word, - CheckSpelling , ( 4.32).

    // = .CheckSpelling();

    // (" !");

    // , // , Word _ = .Visible;// = .Documents.Add();// = .Range(0, 0);// .InsertBefore();// = .Words.Count;

    = 1 // = .Words(); = (.Text);

  • OLE Automation 163

    // = .CheckSpelling();

    (" : " + };;

    ;

    .Close(wdDoNotSaveChanges,,);

    _

    .Quit();;

    (" ! ") ;;

    , .

    MS Word, , . -

    ( 4.33).

    4.33.

    = 1

    // = .Words(); = (.Text);// = .CheckSpelling();

    (" : " + );

    // , // , , = .GetSpellingSuggestions(,,,0);// = .Count;

    > 0

  • 164 4

    = 1 = (.Item().Name);(" : " + );

    ;

    ;

    ;

    ;

    -

    "1:" - 7.7 8.0. - Microsoft Word.

    Microsoft Excel Excel.Application, OLE-MS Excel, , - MS Excel, ., Excel, Application, - workbooks workBook. workBook worksheets worksheet, - charts chart . , , , .

    .

    MS Excel, Microsoft Excel :

    Excel = ("Excel.Application") .

    Excel , Add Workbooks Application:

    E x c e l . W o r k B o o k s . A d d ( ) .

    Add:Excel.WorkBooks.Add(":\Templates\tm.xlt").

    -

    :

    -4109 ; -4167 .

  • OLE Automation /65

    ,

    (, .). -

    Open WorkBooks:Excel.Documents.Open(":\MyExcelFile.xls")., ActiveWorkBook Excel.Application - -

    .

    . ,

    :

    Excel.WorkBooks[2]. Activate:Excel.WorkBooks[2] .Activate() ., , .

    ,

    MS Excel close:E x c e l . W o r k B o o k s [ 2 ] . C l o s e ( ) Excel .Act iveWorkBook.Close() . close ( -) , . , -

    , .

    , ( ). ,

    .

    , ,

    Save SaveAs:Excel.ActiveWorkBook.Save();Excel.ActiveWorkBook.SaveAs("C:\MyWorkBook.xls") . SaveAs , , ( , , .). Excel Quit Excel.Application. Excel . Excel - Printout workBook, :Excel.ActiveWorkBook.Printout() .

  • 166 4

    , -

    Printout ( Excel ).

    worksheets workBook. Worksheet. , :

    Excel.WorkBooks[1].Worksheets[1].Name = " 1". ,

    .

    , :

    Excel.WorkBooks[1].Worksheets["!"].Name = " 1".

    Cells worksheet. , BI :

    Excel .WorkBooks[I] .Worksheets["!"] .Cel l s [1,2] .Value="25" . ,

    .

    :

    Excel.WorkBooks[1].Worksheets["!"].Cells[3,2].Value=" =SUM(B1:B2)". ciearcontents. Font interior ceil . , , - 4.34, Courier 16 .

    1^ ^11^ 11i 4.34.

    Excel.WorkBooks[l].Worksheets[1].Cells[3,2].Interior.Colorlndex = 6;Excel.WorkBooks[1].Worksheets[!].Cells[3,2].Font.Colorlndex = 3;Excel.WorkBooks[1].Worksheets[1].Cells[3,2].Font.Name = "Courier";Excel.WorkBooks[1].Worksheets[1].Cells[3,2].Font.Size = 16;Excel.WorkBooks[1].Worksheets[1].Cells[3,2].Font.Bold = ; Colorlndex 1 56. :

    1 ; 2 ;

  • OLE Automation 167

    ;

    5 ; ;

    7 ; ;

    ;

    39 ; 46 . ActiveCeii - Excel.Application, - Address cell, :(Excel.ActiveCeii.Address). , -

    Range. 4.35 - -

    .

    4.35. :

    Excel.WorkBooks[l].Worksheets[2].Range["A1:C5"].Value = "MAV";Excel.WorkBooks[1].Worksheets[2].Range["A1:C5"].Font.Colorlndex = 3;

    Range . 4.36 , - .

    Excel.WorkBooks[1].Worksheets[2].Range["Al:C5"].Copy();Excel.WorkBooks[l].Worksheets[2].Range["All:CIS"].Select();Excel.WorkBooks [1] .Worksheets [2] . PasteO;

    , , , -

    select.,

    (, Microsoft Word). Excel , . ,

    .

  • 168 4

    Excel chart, , . chart - ,

    chartobjects worksheet - :

    Chart =Excel.WorkBooks[1].Worksheets[2].ChartObjects.Add(10,50,400,400) -

    (1/72 ). ( ), sheets Application ( Worksheets , , -):Excel.WorkBooks[1].Sheets.Add(,,1,-4109). Add , ( , ). , ( , ). , -, . -

    Add WorkBooks Application, - -.

    , ,

    .

    . chart, chartobject ( chartobjects), chartwizard. Range, , , ,

    ( 4.37). , -, .

    . . . . - - . . . - . . . . . . -

    I 4.37. L '_ :.^ :^ ._^ ____ . ,- . _ ___:* ______1^ . 1

    // Ch.Chart.ChartWizard(Excel.WorkBooks[l].Worksheets[2].Range["A1:C5"], -4100);//

  • OLE Automation 169

    Ch.Chart.HasTitle = 1;Ch.Chart.HasLegend = ;Ch.Chart.ChartTitle.Text = " Excel";Ch.Chart.Axes(1).HasTitle = ;Ch.Chart.Axes(1).AxisTitle.Text = " ";Ch.Chart.Axes(2).HasTitle = ;Ch.Chart.Axes(2).AxisTitle.Text = " ";

    chart , . , -

    . 4.37 - (, ). -

    chart, () - (), . Range, ,

    seriescoiiection ( 4.38).

    4.38. , Chi

    Excel.WorkBooks[1].Sheets.Add(, ,1,-4109) ;Excel.WorkBooks[1].Sheets[1].ChartType := -4102;Rng = App.WorkBooks[l].Worksheets[2].Range["B1:B5"];Excel.WorkBooks[1].Sheets[l].SeriesCollection.Add(Rng);

    , ,

    , -

    .

    Microsoft Excel.

    MS Excel -

    "1C: 8.0" Microsoft Excel ( 4.39).

    . MS Excel 8.0

    Excel = ("Excel.Application");

  • 170 4

    (" Excel");;

    ;

    // Excel.Application.Workbooks.Add(1); = Excel.ActiveSheet;// .Name = "";

    = 0;

    //

    (.);

    [.].() > 0 // = + 1;

    // .Cells(, 1).Value = .;

    // [.]

    // = + 1;

    // .Cells(, 1).Value = .;

    //

    = [.].();

    ;

    ;

    > 0 // = + 1;

  • OLE Automation 171

    .Cells(, 1).Value = . +" (" + + ")";

    // = + 1;

    .Cells(, 1).Value = "";.Cells(, 2).Value = "";.Cells(, 3).Value = "";.Cells(, 4).Value = "";

    [.] = + 1;

    // .

    .Cells(, 1).Value = .;

    ;

    .Cells(, 2).Value = .;

    ;

    = "";

    // ..() = + " " + ();

    ;

    .Cells(, 3}.Value = ;

    ;

    .Cells(, 4).Value = .;

    ;

    ;

    ;

    ;

    ;

    ;

  • 172 4

    ;

    // Excel.Visible = ;Excel = ;

    , 4.21, , MS Excel. , -

    , .

    4.40 MS Excel .

    | 4.40. MS Excel

    // = .Cells(, );// 2 .Insertlndent(2);// .Font.Size = 12;// .Font.ColorIndex = 5;// .Font.Bold = ;// .ColumnWidth = 20;// .Borders(5).LineStyle = -4142;// .Borders(1).LineStyle = 1;// .Borders(8).LineStyle = 1;// .Borders(9).LineStyle = 1;// .Borders(10).LineStyle = I;11 .VerticalAlignment = -4160;// .WrapText = ;

  • OLE Automation 173

    .

    , -

    , , , . .

    MS Excel , "1:", Microsoft Excel. - MS Excel (. 4.1) .

    -f A 1 ( 2 IMAV -:4567

    9101112131415161718

    , $ -^( *. 91. 60. 68. 69. 70

    . 70

    . 73. 10. 20. 26

    _L D _j

    (OS.2004 032004

    -4688,02 -407,66-4812 -9116,2

    ; -1739,4-2929,64-17028,9

    I -12228,41; -29257,31: -1854,6

    -346,611 -627,48-390

    -383,18-9846,63: -46705,47

    -5095,68-13928,2

    -1739,4-2929,64-17028,9

    -12228,41-29257,31

    -1854,6-974,09

    -390-383,18

    -56552,1

    . 4.1. MS Excel

    "1:" OLE-MS Excel . ( 4.41).

    I 4.41. MS Excel 7.7

    (, , , ) ;

    ..() < 2 (" ,

  • 174 4

    !", 5); 0;

    ;

    // Excel-ServerExcel = ("Excel.Application");

    ( ,"!"); 0;

    ;

    Excel.Application.Workbooks.Add(1);Excel.ActiveSheet.Name = "";

    // = 1 .() = 1 .() = .(, );Excel.ActiveSheet.Cells(+1, ).Value = ; = 1

    . (,"",0,0,,0,"",1);Excel.ActiveSheet.Cells(1, ).Value = ;

    ;

    ;

    ;

    // Excel.Application. ActiveWorkbook.PivotCaches() . Add(1, "!R1C1:R" +(1+.()) + "" +.()). CreatePivotTable("", "");Excel.ActiveSheet.Name = "";

    // Excel.Rows("1:4").Select ();Excel.Selection.Insert(-4121);Excel.ActiveSheet.Cells(1, 1).Value = ;Excel.ActiveSheet.Cells(1, 1).Font.Size = 16;

  • OLE Automation 175

    Excel.ActiveSheet.Cells(1, 1).Font.Colorlndex = 3;Excel.ActiveSheet.Cells(1, 1).Font.Bold = 1;Excel.ActiveSheet.Cells(1, 1).Font.Italic = 1;Excel.ActiveSheet.Cells(1, 1).Font.Underline = 2;

    Excel.ActiveSheet.Cells(2, 1).Value = ;Excel.ActiveSheet.Cells(2, 1).Font.Size = 8;Excel.ActiveSheet.Cells(2, 1).Font.Colorlndex = 3;

    Excel.ActiveSheet.Cells(3, 1).Value = ;Excel.ActiveSheet.Cells(3, 1).Font.Size = 8;

    Excel.ActiveSheet.Cells(7, 1).Select();

    // . ExcelExcel.Application.Visible = 1;

    Excel.Quit();( ,"!"); 0;

    ;

    1; //

    -

    .

    , -

    . -

    MSExcel;

    ( ), Excel;

    ( ), - Excel;

    ( ), Excel.

    1, , .

  • 176 4

    Microsoft PowerPoint PowerPoint.Application, OLE-MS PowerPoint, -.

    PowerPoint Application, Presentations () Presentation. Presentation slides () slide, -. , , shapes shape, - . ,

    .

    MS PowerPoint -

    Open Presentations:.Presentat ions.Open(":\MyPresentat ion.ppt"); , ActivePresentation PowerPoint.Application - . ,

    . , -

    :

    .Presentations.Item(2) . 4.42 MS PowerPoint -.

    // PowerPoint = ("PowerPoint.Application");// .Visible = ;// . Presentations. Open (": \.ppt") ;// .Quit();

    , PowerPoint, Word Excel, - Application Activate , -

  • OLE Automation 177

    . -

    windows Presentation DocumentWindow SlideShowWindow, -: . P r e s e n t a t i o n s . I t e m ( l ) . W i n d o w s . I t e m ( l ) . A c t i v a t e ( ) .

    ,

    , close:. Presentat ions.I tem(2).Close ( ) . ActivePresentation.Close ( ) . , PowerPoint close , .

    ,

    .

    ^

    Word Excel Close , .

    save

    SaveAs. :.Presentations.Item(2).Save();. Presentations. Item(2) . SaveAs (": \-.ppt") . SaveAs , , . () - , , -

    . ,

    .

    (). , - . :

    1 PowerPoint; 2 PowerPoint ( 7); PowerPoint ( 4); 4 PowerPoint ( 3); 5 ; RTF; 7 SlideShow (*.pps);d 8 PowerPoint Addln (*.ppa); PowerPoint 4 Far East ( , ,

    - );

  • 178 4

    ,

    PowerPoint; 12 HTML; 13 HTML ( 3); 14 HTML ;

    15 WMF; 16 GIF; 17 JPG 18 PNG; 19 BMP. , -

    . ( -) ( ). .

    PowerPoint Quit PowerPoint.Application. PowerPoint .

    PowerPoint Printout Presentation, :.Presentations.Item(2).Printout(). , -

    () Printout. PowerPoint . ,

    .

    , .

    ( ) , . - , -

    , ( ) . , C:\MyOutput.prn :

    .Presentations.Item(2) .Printout(5,20,":\MyOutput.prn",3) ., Printout, , - , -

    Printoptions Presentation. Printoption, , -, , ,

    (, , .), , , -

    . ,

  • OLE Automation 179

    PowerPoint , Print PowerPoint ( , , ).

    Run Slideshowsettings, - Presentation:.Presentations.Item(l).SlideShowSettings.Run() .

    Slideshowsettings. RangeType , - .

    :

    1 ; 2 ; .

    StartingSlide EndingSlide SlideShowSettings - .

    , RangeType 2. AdvanceMode Slideshowsettings , - :

    1 ; 2 ; .

    LoopUntiistopped Slideshowsettings, - , ,

    . , AdvanceMode Slideshowsettings - 2. , , , ,

    siideShowTransition slide. 4.43 .

    = 2 7 .Presentations.Item(I).Slides.Item().SiideShowTransition.AdvanceTime = 1;

    .Presentations.Item(1).Slides.Item().SlideShowTrans ition.AdvanceOnTime = ;

  • 180 4

    ;

    .Presentations.Item(l).SlideShowSettings.StartingSlide = 2;App.Presentations.Item(1).SlideShowSettings.EndingSlide = 7;App.Presentations.Item(1).SlideShowSettings.AdvanceMod = 2;App.Presentations.Item(l).SlideShowSettings.LoopUntilStopped = ;App.Presentations.Item(l).SlideShowSettings.RangeType = 2;App.Presentations.Item(l).SlideShowSettings.Run();

    -

    , ,

    -

    , . siideShowTransition slide . 4.44 , ,

    .

    4.44.

    App.Presentations.Item (I).Slides.Item (2).SiideShowTransition.EntryEffeet = 770;App.Presentations.Item(1).Slides.Item(2).SiideShowTransition.SoundEffect.ImportFromFile("C:\Program Files\NetMeeting\blip.wav");

    EntryEffect PowerPoint. -

    . -

    AnimationSettings shape. AnimationSettings, - . , AdvanceMode , - , AdvanceTime . TextLeveiEffeet , . , Animate( ) , - .

    4.45.

    " * "

    " "

    4.45.

    App.Presentations.Item(l).Slides.Item(3).Shapes.Item(1)AnimationSettings .AdvanceMode = 2;App.Presentations.Item(1).Slides.Item(3).Shapes.Item(1)AnimationSettings .AdvanceTime = 1;

  • OLE Automation 181

    App.Presentations.Item(1).Slides.Item(3).Shapes.Item (1).AnimationSettings.TextLevelEffect = 16;App.Presentations.Item(l).Slides.Item(3).Shapes.Item(1).AnimationSettings.Animate = ;

    -

    .

    Adobe Photoshop OLE- Adobe Photoshop - , .

    Adobe Photoshop -, 4.46.

    // PhotoshopPhotoshop = ("Photoshop.Application");// Photoshop.Visible = ;// Photoshop.Quit();

    , OLE- Adobe Photoshop , . .

    .

    Open Photoshop. 4.47 - .

    // PhotoshopPhotoshop = ("Photoshop.Application");// PhotoDoc = Photoshop.Open (":\picture.jpg");// PhotoDoc.Close();// Photoshop.Quit();

  • 182 4

    ,

    Adobe Photoshop (Action).

    piayAction Photoshop - . 4.48 Photoshop "Quadrant colors", .

    // PhotoshopPhotoshop = ("Photoshop.Application");// PhotoDoc = Photoshop.Open(":\picture.jpg");// (Action) Photoshop.PiayAction("Quadrant Colors");// PhotoDoc.SaveTo(":\NewPicture.psd");// PhotoDoc.Close();// Photoshop.Quit();

    , SaveTo , -

    .

    (Action) ,

    .

    , ,

    Adobe Photoshop , Actions Photoshop ( 4.49).

    // PhotoshopPhotoshop = ("Photoshop.Application");// PhotoDoc = Photoshop.Open(":\picture.jpg");//

  • OLE Automation 183

    Action Photoshop.Actions

    = (" " + Action.Name +"?",.,,," ?"); = .

    Action.Play(); = .

    ;

    ;

    ;

    // PhotoDoc.Close();// Photoshop.Quit();

    Actions. - (Action) -, .

  • 5

    ADO

    ADOADO (Microsoft ActiveX Data Objects) , -. -

    . ADO OLE DB, - . OLEDB, , -.

    OLE DB ADO - Microsoft (Microsoft Universal Data Access), - (- ), , , -

    , , . ,

    , -

    . , ,

    . -

    -

    , , .

    Microsoft

    .

    Microsoft . Microsoft ActiveX Data Objects (ADO)

    . -

    , ADO - - OLE DB.

  • 186 5

    OLE DB . ADO OLE DB, OLE DB , - ADO.

    Open Database Connectivity (ODBC) - .

    -

    .

    ODBC- OLE DB-. OLE DB , , , OLEDB- . OLE DB- DLL, - . -

    OLE DB-, API (Application Programming Interface, ), .ADO OLE DB-. OLE DB-, MicrosoftData Access Components, , - . ADO , - , -

    , .

    connection . .

    ,

    . connection, (, SQL-) Execute. - , Recordset, - .

    Error , - .

    command , . SQL- . -

    Parameters - Command.

    Recordset , -, , , ,

    .

    Connection Command.

  • ADO 187

    Field , Recordset. , , ,

    .

    Record Recordset

    ( ADO 2.5, Windows 2000).

    stream , Record. , Record , stream ( ADO 2.5).

    Connection. ( 5.1) ( 5.2).

    // Connection = ("ADODB.Connection");

    //

    Connection.Open();

    (() ) ;;

    ;

    // Command = ("ADODB.Command");// Command.ActiveConnection = Connection;// Command.CommandText = "SELECT * FROM titles";// Command.CommandType = 1;

  • 188 5

    // RecordSet = ("ADODB.RecordSet");// RecordSet = Command.Execute();

    // RecordSet.EOF() = 0 (RecordSet.Fields(0).Value);RecordSet.MoveNext();

    ;

    // , RecordSet.Close();Connection.Close();

    // Command = ("ADODB.Command");// ConnectionCommand.ActiveConnection = ;

    // Command.CommandText = "SELECT * FROM titles";// Command.CommandType = 1;

    // RecordSet = ("ADODB.RecordSet");// RecordSet.Open(Command);

    // RecordSet.EOF() = 0 (RecordSet.Fields(0).Value);RecordSet.MoveNext();

    ;

  • ADO 189

    /I , RecordSet.Close ();Connection.Close();

    ,

    , -

    Connection. .

    -

    .

    , . -

    -

    OLE DB.

    .

    |6 j ]

    !.. SQL Server :1. :

    MAVCOMP jj2. :

    Windows NT: (* :

    :

    :

    *

    . - 3 (

    mav

    **

    :

    JNorthwind j^ J" :

    '.

    " ' : . . ! :,0" ||

    . 5.1.

  • 190 5

    -

    UDL . - (. 5.1), , -

    UDL-. -

    5.3.

    // DataLinks = ("DataLinks");// Connection Connection.ConnectionString = ;

    // DataLinks.PromptEdit(Connection);// = Connection.ConnectionString;

    ();

    ,

    Connection. , (. 5.1)., Microsoft SQL Server - :

    "Provider=SQLOLEDB.l; Password=erpg; Persist Security Info=True; UserID=mav; Initial Catalog=Northwind; Data Source=MAVCOMP" UDL-, :

    "FileName=C:\DataLinks\MyDataLink.udl" .

    Provider OLE DB. User ID . Password . Persist Security Info

    (True/False). Initial Catalog .

  • ADO

    Data Source (, , . .);

    File Name UDL-. OLE DB-. , 5.1, - connection. ADO, - . -

    , , connectionstring, . ODBC-. Connection. ConnectionTimeout , -

    ODBC-. 15. - , ,

    , -

    . 0, .

    CommandTimeout , . 30.

    ! Connectionstring ODBC-. DefauitDatabase . state ( , 1 ). connection. open -

    :

    Connectionstring , - connectionstring , - connection . Connectionstring;

    userio ; Password ( userio Password -

    Connectionstring, ). close ,

    Recordset, , -, connection, , . . - open .

    Execute SQL- - Recordset, : commantText , SQL-, , -

    ;

  • 192 _ _ _ 5

    RecordsAf fected , ;

    options commandText ( - ) : 1 SQL- ; 2 ;

    4 ;

    8 .

    | , Recordset, ,

    .

    , ,

    -

    .

    SQL-

    , SQL- Execute Connection, -

    command. , command SQL-, Recordset , .

    Command ( ), - . -

    .

    command SQL-, - .

    ADO, command - Connection ( 5.1), ( 5.2). command , SQL-, -

    , Recordset.

  • ADO 193

    (- 5.4).

    "= "

    I INSERT

    I INTO Users(Parentld, IsFolder, FIO, Login, Password, Description)I VALUES (" + 2 + "," + 1 + ", "' + . + "'," +. + "','pass',' ')";

    Command = ("ADODB.Command");Command.ActiveConnection = Connection;Command.CommandText = ;

    .

    Command.CommandType = 1;

    // RecordSet = Command.Execute();

    ] , -

    , SQL

    Command. ActiveConnection ,

    Command, , connection. ,

    Command Recordset, . CommandText SQL-,

    , command. , SQL-, ,

    .

    commandTimeout - Command . command - .

    30 . , ,

    .

    7 . 722

  • 194 5

    commandType command . - , CommandText command, - . Option Execute - connection, : 1 SQL- ; 2 ; 4 ; 8 .

    state - objectstateEnum. - Command , , . . :

    ;

    1 ; 2 ; 4 ; 8 .

    command. Execute SQL- . -

    Recordset. CreateParameter -

    Parameter, Parameters command , . Parameter , SQL- , - CommandText Command.

    , -

    . -

    .

    1. CreateParameter Parameter.2. Parameters Command.3. Execute command,

    Recordset.

    ( 5.5).

  • ADO 195

    11 CommandCommand = ("ADODB.Command");// CommandCommand.ActiveConnection = Connection;// Command.CommandText = "SP_GET_AUTHOR_INFO";// CreateParameter Command // Parameter, // .Parameter = Command.CreateParameter("SUSERNAME", 200, 1, 12, "MAV"};// Parameters Command Command.Parameters.Append(Parameter);// RecordsetRecordset = Command.Execute();

    CreateParameter :CreateParameter(Name, Type, Direction, Size, Value).

    .

    Name , . , command. -

    , CreateParameter, -,

    , .

    . 5.1. Direction ,

    , ,

    . ,

    , ,

    . -

    :

    , , .

    . 5.2. size Parameter ,

    Parameters, - size, .

    value , - Connection (ADO -

  • 196 5

    ). , ,

    Return: ReturnParameter =Command. CreateParameter ("Return", 3 , 4 ) , ,

    ReturnParameter.Value.

    5.1. , ADO

    ADOadBiglnt

    adBinary

    adBoolean

    adBSTR

    adChar

    adCurrency

    adDate

    adDBDate

    adDBTime

    adDBTimeStamp

    adDecimal

    adDouble

    adEmpty

    adError

    adGUID

    adIDispatch

    adlnteger

    adIUnknown

    adLongVarBinary

    20

    128

    11

    8

    129

    6

    1

    133

    134

    135

    14

    5

    0

    10

    72

    9

    3

    13

    205

    8-

    , -

    Null ( Unicode)

    (8- , 10000)

    ( "") ( "") ( "_____" ) -

    -

    32- (QUID) IDispatch OLE-4- lUnknown OLE- ( - Parameter)

    adLongVarChar 201 , - Null ( Parameter)

  • ADO 197

    5.1 () ADOadLongVarWChar

    adNumeric

    adSingle

    adSmalllnt

    adTinylnt

    adUnsignedBiglnt

    adUnsignedlnt

    adUnsignedSmalllnt

    adlnsignedTinylnt

    adUserDef ined

    adVarBinary

    adVarChar

    adVariant

    adVarWChar

    adWChar

    203

    131

    4

    2

    16

    21

    19

    18

    17

    132

    200

    12

    202

    130

    ( - Parameter)

    2- 1 - 8- 4- 2- 1 - ,

    ( Parameter) ( Parameter) OLE- Unicode, Null ( Parameter) Unicode, Null

    5.2. Direction Crea teParameter

    ADO adParamUnknownadParamlnput

    adParamOutput

    adParamlnputOutput

    adParamReturnValue

    ( ) -

    -

    -

    SQL- OUTPUT

    -

    ,

    -

  • 198 5

    Recordset. Recordset . :

    ("ADODB.RecordSet") . , , ,

    , .

    .

    , . ,

    CursorType, . ,

    Fields Recordset. Field. , - ( 5.6).

    5.6. , Recordset

    // Command = ("ADODB.Command");// Command.ActiveConnection = Connection;// Command.CommandText = "SELECT * FROM titles";// Command.CommandType = 1;

    // RecordSet = ("ADODB.RecordSet");// RecordSet = Command.Execute();

    // RecordSet = 0 RecordSet.Fields.Count-1

    (" " + RecordSet.Fields.Item().Name);;

    , -

    .

  • ADO 199

    ,

    , ,

    , ( 5.7).

    // = RecordSet.Fields.Count; RecordSet.EOF() = 0

    // = 0 -1 = RecordSet.Fields.Item().Name; = RecordSet.Fields().Value;(": " + + " = " + );

    ;

    // RecordSet.MoveNext();

    ;

    RecordSet . ActiveConnection Connection, -

    Recordset. source - , . . SQL-,

    .

    Filter , . . SQL-, WHERE.

    CursorType . , - , :

    (Forward only-) - ( - , -

    ); i (Keyset-)

    , , -

    ;

    2 , , ,

    ( );

  • 200 5

    (- ), , , , (,, -

    ). state :

    ;

    1 / BOF ( ). ,

    .

    EOF . , - .

    EditMode (- update ). :

    , ;

    1 , , ;

    2 , AddNew, .

    RecordCount (, CursorType = 3).

    AbsoiutePosition . 1 RecordCount (-, CursorType = 3).

    Bookmark . .

    ^

    Bookmark - , (-, CursorType = 3).

    Pagesize . (, CursorType = ).

    Pagecount . - Pagesize (, CursorType = );

    AbsoiutePage (-, CursorType = 3).

  • ADO 201

    , Recordset . Open -.

    : RecordSet.Open(Sourse, ActiveConnection, CursorType), - Source, ActiveConnection CursorType ,

    Recordset. , ActiveConnection - Connection, ConnectionString.

    close . Requery . -

    close Open. clone Recordset ( ).

    ,

    .

    MoveFirst, MoveLast, MoveNext, MovePrevious , , -

    .

    Move . :Recordset.Move(NumRecords, Start), NumRecords - , .

    , -

    . start , .

    ^^ ^^^ ^^ -4|| I

    , : - , ; 1 - ; 2 .

    AddNew . , - . :

    RecordSet.AddNew(Fields, Values). Fields , , values ( , Update).

    Delete . : Recordset.Delete(AffectRecords), - Af fectRecords : 1 ( ) ; 2 , Filter, -

    .

  • 202 5

    update . :

    Recordset.Update(Fields, V a l u e s ) . Fields , ,

    values . - , -

    Update. Canceiupdate ,

    update.

    (ADOX) ADO Exten-sions for Data Definition and Security (ADOX). ADOX ,

    , .

    ADOX -, SQL , .

    ^

    , ADOX - Microsoft Access Microsoft SQLServer, .

    ADOX , :

    Catalog ; Table ; Column ; index ;! Key ; Group ; user

    ;

    Procedure ; view (view) . ADOX catalog. - , , ,

  • ADO 203

    ( - ADO Connection), . catalog, , ., Tables, , , -

    , Columns, indexes Keys Table. , ,

    , - . -

    users Groups, - , -

    .

    , -

    ( 5.8).__.. ~, :__.

    5.8. ,

    // Catalog = ("ADOX.Catalog");Catalog.ActiveConnection = ;

    // = 0 Catalog.Tables.Count-1 = Catalog.Tables.Item().Name;(": " + );

    ;

    // Views

    = Catalog.Views.Count; = ;

    = ;

    ;

    // = 0 Catalog.Views.Count-1

  • 204 5

    = Catalog.Views.^().Name;(": " + );

    ;

    ;

    // = 0 Catalog.Procedures.Count-1 = Catalog.Procedures.Item().Name;(": " + );

    ;

    Tables, views Procedures Catalog. , views ,

    ....... ,

    , , ADOX - views . Tables Table, columns, indexes Keys, ( 5.9).

    // Catalog = ("ADOX.Catalog");Catalog.ActiveCdnnection = ;

    // = 0 Catalog.Tables.Count-1

    Table = Catalog.Tables.Item(); = Table.Name;(": " + );

    // Table.Columns.Count > 0

    = 0 Table.Columns.Count-1 Column = Table.Columns.Item();

    ' = Column.Name; = Column.Type;

  • ADO 205

    = Column.DefinedSize;(" : " + );(" : " + );(" : " + );

    ;

    ;

    // Table.Indexes.Count > 0

    = 0 Table.Indexes.Count-1 Index = Table.Indexes.Item(); = Index.Name;(" : " + );

    ;

    ;

    //. Table.Keys.Count > 0

    = 0 Table.Keys.Count-! Key = Table.Keys.Item(HoMepKruo4a) ; = Key.Name;

    (" : " + );;

    ;

    ;

    column.Type , , . 5.1. column. Attributes . DefinedSize . NumericScale

    .

    Parentcatalog , . Precision .CJ ReiatedCoiumn . Sortorder . , .

  • 206 5

    index . clustered , . indexNuiis , Null. PrimaryKey , . unique , ,

    .

    , Key. DeieteRuie , -

    , .

    RelatedTable . - .

    updateRuie , , - .

    -

    Catalog. ( OLE D -), . 5.10 , Microsoft Access.

    // = "C:\demo.mdb"; = "Provider=Microsoft.Jet.OLEDB.4.;Data Source=" +;

    // ADOX CatalogCatalog = ("ADOX.Catalog");// MDB-Catalog.Create();

    .

    . , :

    1. Table Ta-bles Catalog.

    2. Column Columns Table.

  • ADO 207

    ( 5.11) , .

    // 1. TableTable = ("ADOX.Table");// = "NewTable";Table.Name = ;// Catalog.Tables.Append(Table);

    // 2. Column// = "NewColumn";// (3-adInteger)Catalog.Tables().Columns.Append(, 3);

    .

    , .. Key (Primary key) (Foreign key) . ( 5.12).

    ForeignKey = ("ADOX.Key");ForeignKey.Name = "CustOrder";ForeignKey.Type = 1; // adKeyForeign

    // ForeignKey.RelatedTable = "Customers";// ForeignKey.Columns.Append("Customerld");// ForeignKey.Columns("Customerld").RelatedColumn = "Customerld"// ForeignKey.UpdateRule = adRICascade;

    // Catalog.Tables("NewTable").Keys.Append(ForeignKey);\

  • 208 5

    ForeignKey.Type :

    1 (adKeyPrimary) ; 2 (adKeyForeign) ; 3 (adKeyUnique) . ForeignKey.updateRule : (adRiNone) (-

    ); 1 (adRicascade) ; 2 (adRisetNuii) Null; (adRisetDefauit)

    .

    .

    ^

    , , -

    . , ,

    , -

    , .

    ,

    : Fieldl Filed2 ( 5.13).

    5.13.

    Index = ("ADOX.Index");

    // Index.Name = "Indexl"Index.Columns.Append("Fieldl");Index.Columns.Append("Field2");

    // Catalog.Tables("NewTable").Indexes.Append(Index);

    Delete. , , ( 5.14).

  • ADO 209

    = "NewTable";// Catalog.Tables().Indexes.Delete();// Catalog.Tables().Keys.Delete();// Catalog.Tables().Columns.Delete();//

    Catalog.Tables.Delete();

    (());;

    ;

    ...

    ... ,

    .

    , . ,

    -

    .......

    Microsoft Excel OLE DB

    , Microsoft Excel. Excel "1:". , OLEAutomation, 4, ADO. ADO, Microsoft Excel, .

    Excel :Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\file.xls;Extended Properties="Excel 8.0;HDR=NO;".

  • 210 5

    HDR , YES ; NO . Microsoft Excel XLS. , - ADOX. MicrosoftExcel ADOX ( 5.15).

    MS Excel ADOX

    // = "C:\ExcelDemoFile.xls"; = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source + "; Extended Properties=""Excel 8.0;HDR=NO; ';

    // Catalog = ("ADOX.Catalog");Catalog.ActiveConnection = ;

    // Table = ("ADOX.Table");// Table.Name = "TestTable";

    = 1 5

    // Column = ("ADOX.Column");// Column.Name = "Col" + ;// = 2 Column. = 202; // adVarWChar

    Column.Type =5; // adDouble;

    // Table.Columns.Append(Column);Column = ;

    ;

    // () ExcelCatalog.Tables.Append(Table);

  • ADO 211

    C:\ExcelDemoFile.xls, - TestTabie . column . Microsoft Excel , - . 5.3.

    5.3. Column MS Excel

    ADO

    adDouble

    adDate

    adCurrency

    adBoolean

    adVarWChar

    adLongVarWChar

    5

    7

    6

    11

    202

    203

    (8- , 1 0 000)

    Unicode, Null

    Excel , - - Excel. - , AddNew Recordset (- 5.16), SQL-, INSERT( 5.17).

    ...

    5.16. MS

    // ADO ExcelConnectionExcel = ("ADODB.Connection");ConnectionExcel.Open();

    // RecordsetExcel = ("ADODB.Recordset");RecordsetExcel.Open("Select * from TestTabie", ConnectionExcel, 1, 3)

    = 1 10

    // RecordsetExcel.AddNew();RecordsetExcel.Fields(0).Value = 11;RecordsetExcel.Fields(1).Value = " " + ;

  • 212 5

    RecordsetExcel.Fields(2).Value = 2.30;RecordsetExcel.Fields(3).Value = ;RecordsetExcel.Fields(4).Value = * 2.2;

    // ExcelRecordsetExcel.UpDate();

    ;

    // ConnectionExcel.Close();ConnectionExcel = ;

    AddNew Excel. , 65 000 Microsoft Excel. , Excel . ,

    Column ,

    . ,

    , . . ,

    ,

    Microsoft Excel .

    , SQL- ( 5.17)., - - , _ _ _ _ .

    1 5.17. MS Excel SQL-

    // Connection = ("ADODB.Connection");

    //

    Connection.Open();

    (() ) ;;

    ;

    //

  • ADO 213

    Command = ("ADODB.Command");// Command.ActiveConnection = Connection;// Command.CommandText = "INSERT INTO TestTable VALUES(20, ' ',33.3, 44.4, 55.5)";// Command.CommandType = 1;// Command.Execute();

    // Connection.Close();Command = ;

    , 5.4, - , INSERT .

    Excel . 5.18.

    | 5.18. MS Excel ADOL^ i^ L; _. :-i^ _-_ :^ j_L ^_._ -_--;_-__ ____i__. i._^_. :_:_..^ _-_i_-.-._-l.^

    // // Connection = ("ADODB.Connection");

    //

    Connection.Open();

    (());;

    ;

    // Command = ("ADODB.Command");// Command.ActiveConnection = Connection;

  • 214 5

    I/ Command.CommandText = "SELECT * FROM TestTable";

    // Command.CommandType = 1;

    // RecordSet = ("ADODB.RecordSet");// RecordSet = Command.Execute() ;

    // RecordSet.EOF() = 0 (": " + Recordset.Fields(1).Value);(": " + Recordset.Fields(4).Value);RecordSet.MoveNext();

    ;

    (// , RecordSet.Close();Connection.Close ();

    Microsoft Project OLE DB Microsoft Project ADO. , MS Project, , ,

    .

    OLE DB MicrosoftProject - .

    :

    text ;

    number ;

    boolean ; date - ( , ,

    27.12.1999 10:30).

  • ADO 215

    , 10 (-, 8 4800), , - 1000 (8 480 000).

    , NA ( ), - .

    , -

    #ERROR, . , ,

    , .

    G , -, -i.

    -

    , , , 1000. SELECT WHERE -

    . WHERE, , .

    OLE DB Microsoft Project 2002 .

    .

    .

    , , -

    .

    OLE DB ( -) . , MovePrevious, MoveFirst MoveLast. , Recordcount.

    ,

    , -

    , -

    . -

    .

    ANY, LIKE is NOT. Sum, Avg, Min, , count

    StDev.

    OLE DB , - , ,

    , . TimeBeforeUnioad 1, ,

  • 216 5

    . .

    , ,

    , . -

    , , , ,

    .

    ADO OLE DB -, , . ADO: ;

    Microsoft Project Server. 5.19 Microsoft Project -, .

    5.19.

    // = "Microsoft.Project.OLEDB.10."; = "C:\example.mpp";// , // User ID () Password () = "";

    = "";

    //

    Connection = ("ADODB.Connection");Connection.Open("Provider=" + () +

    ";Project Name=" + () +";User ID=" + () +";Password=" + ());

    (());;

    ;

    // Command = ("ADODB.Command");Command.ActiveConnection = Connection;Command.CommandText = "SELECT * FROM Project";

  • ADO 217

    RecordSet = ("ADODB.RecordSet");,

    RecordSet = Command.Execute();

    // = RecordSet.Fields("ProjectTitle").Value; = RecordSet.Fields("ProjectStartDate").Value; = RecordSet.Fields("ProjectFinishDate").Value;

    // (" : " + );(" : " + );(" : " + );

    C:\example.mpp , Project (). - .

    Project . - . 5.4.

    5.4. Project

    Project () text , ,

    C:\example.mppProjectUniqueID( - )ProjectAuthor text()ProjectCompany text()

    ProjectCreationDate date( )ProjectStartDate date( )ProjectFinishDate date( )

    number

    . -

    , ;

  • 218 5

    5.4 ()

    ProjectLastSaved( )ProjectManager()

    ProjectRevision()ProjectSubject()ProjectTitle()

    date

    text . , -

    text

    text .

    text . -

    Project ADOX ( 5.20).

    // = "Microsoft.Project.OLEDB.10.0"; = "C:\example.mpp";

    // Catalog = ("ADOX.Catalog") ;Catalog.ActiveConnection = "Provider=" + Co) + ";ProjectName=" + (); .

    Table = Catalog.Tables.Item("Project");// Table.Columns.Count > 0 = 0 Table.Columns.Count-1

    Column = Table.Columns.Item(); = Column.Name;

    = Column.Type;

    = Column.DefinedSize;(" : " + );(" : " + );

  • ADO 219

    (" :;

    ;

    " + );

    , ,

    , Tasks, - . 5.5.

    5.5. Tasks

    TaskUniquelD()Tas kActual Start( )Tas kActual Finish()TaskActualWork()TaskStart()

    number

    date

    date

    number

    date

    -

    ,

    -

    , -

    TaskContact text( )TaskName () textTaskNotes () textTaskOutlineLevel number( )TaskOutlineNumber text( )

    TaskPercentComplete number( )

    . TaskFinish -

    ,

    , -

    . ,

    7.2 , - -

    ,

    -

  • 220 5

    .

    Assignments . Assignments . 5.6.

    5.6. Assignments

    TaskUniquelD ( number )AssignmentUniquelD( )AssignmentResourcelD number( )AssignmentActualStart date( )AssignmentActualFinish date( )AssignmentActualWork number( )AssignmentStart () date

    AssignmentFinish date()AssignmentFinishVariance number( )

    AssignmentNotes () textAssignmentUnits () number

    AssignmentWork number()

    AssignmentResourceName text( )AssignmentResourceType number( )

    -

    Tasks

    number

    -

    Resources

    -

    ,

    -

    -

    -

    ,' -

    .

    -

    ,

    , -

    : 0 ( -, );1 ( -, , , )

  • ADO 221

    -

    "1C:" 8.0 ( 5.21).

    .,..., ..^ -....-.....,.-

    -...-:-,........ --;~ "'----"' - """"""

    ; 5.21.

    | 8.0

    // .. . ( ) = (, "."); = 0;

    = 0 "";

    = 1

    = + ((, +1), ".");;

    (, - 1);;

    // () = "Microsoft.Project.OLEDB.10.0"; = "C:\example.mpp"; = "";

    (" . ...");

    Connection = ("ADODB.Connection");Connection.Open("Provider=" + Co() +

    ";Project Name=" + () +";Password=" + ());

    (());;

    ;

    // Command = ("ADODB.Command");

    ' ]

  • 222 5

    Command.ActiveConnection = Connection;Command.CommandText = "SELECT

    TaskName,TaskType,TaskUniquelD,TaskOutlineLevel,TaskOutlineNumber,TaskStart,TaskFinish,TaskPercentComplete FROM Tasks";

    RecordSet = ("ADODB.RecordSet");RecordSet = Command.Execute();

    // RecordSet.EOF() = 0 // : 1-, 0- = RecordSet.Fields("TaskType").Value;// = RecordSet.Fields("TaskName").Value;// = RecordSet.Fields("TaskUniquelD").Value;// = RecordSet.Fields("TaskOutlineLevel").Value;// .. = RecordSet.Fields("TaskOutlineNumber").Value; = RecordSet.Fields("TaskStart").Value; = RecordSet.Fields("TaskFinish").Value; = RecordSet.Fields("TaskPercentComplete").Value;

    = 0

    = ;

    // =

    ..((),"", ); =

    .= ;

    = ;

    ;

    ;

    // = ..();

  • ADO 223

    . = ;

    . = ;

    . = ;

    . = ;

    = "";

    = 0 // // Command = ("ADODB.Command");Command.ActiveConnection = Connection;Command.CommandText = "SELECT AssignmentUnits,AssignmentResourceName FROM Assignments WHERE AssignmentResourcelD >0 AND TaskUniquelD = " + ;

    RecordSetResource = ("ADODB.RecordSet");RecordSetResource = Command.Execute();

    // RecordSetResource.EOF() = 0 =

    RecordSetResource.Fields("AssignmentResourceName"). Value; =

    RecordSetResource.Fields("AssignmentUnits"). Value * 100; = + ?(="","","; ") +() + " (" + + "%)";RecordSetResource.MoveNext();

    ;,

    RecordSetResource.Close();;

    . = ;

    // RecordSet.MoveNext();

    ;

    RecordSet.Close();

    , -

    .

    :

    , ;

  • 224 5

    ;

    ;

    ;

    , -

    .

    . 5.2.

    i-r Microsoft Project ADO Demo vl .0 MAV 2004 _ X : | C:\eitample.mpp __ j-^ |OLEDB : [Microsoft.PrQiect.OLEDB.10.0

    : ^.B-Deveioprnent 25.05.2004 9:00:00 20.07.2004 9:52:54

    - 25.05.20049:00:00 03.06.200410:30:00- 01.06.200416:44:59 20.07.20043:52:54

    ^ 01.06.200416:44:59 20.07.20049:52:54| ... 01.06,200416:44:59 03.06.200414:24:06 (1002); ...;| ... 03.06.200414:24:06 06.06.20049:52:48 (100%); ... \' , 06.06.20049:52:48 09.06.200415:22:48 (100%}: ...;

    09.06.200415:22:48 06.07.200417:50:06 (1..J 06.07.200417:50:06 13.07.200411:06:30 .. 13.07.200411:06:30 19.07.200415:22:54 (1...J 19.07.200415:22:54 20.07.20049:52:54 (50 )^; ... =

    - ... 02.06.200410:30:00 07.06.200413:44:59- 09.06.2004 15:22:48 16.06.200415:22:48

    1 09.06.200415:22:48 16.06.200415:22:48 (100);...;

    . 5.2.

    , (project, Tasks Assignments), , ,

    . .

    Availability - .

    BaseiineTaskSpiits .

    caiendarData caiendarExceptions - , Microsoft Project OLE DB.

    Calendars , - .

  • ADO 225

    . ,

    . -

    .

    CostRates Resources , -

    . , -

    Assignments , - .

    CustomFieidGraphicaiindicators CustomFieids -, .

    CustomFieids ( ) .

    .

    CustomFieidVaiueList - ,

    .

    CustomOutlineCodeFieids ( ) -

    .

    GustomOutiineCodeLookupTabies ( ) - -

    , .

    Predecessors () Tasks -.

    Resources , . Successors Tasks

    -.

    TaskSpiits - .

    WBS ( ) - , .

    8 . 722

  • 6

    SQL-DMO SQL-DMOSQL-DMO (SQL Distributed Management Objects) Microsoft SQL Server , --.

    SQL-DMO Transact-SQL MicrosoftSQL Server. Microsoft SQL Server - SQL-DMO,

    .

    SQL-DMO , ,

    . :

    (, , , ); ;

    ;

    G ; ;

    SQL- (, , , );

    SQL-. SQL-DMO - , MicrosoftSQL Server, Microsoft SQL OLE ObjectLibrary. ActiveX- - SQL-DMO. SQL-DMO SQL Server.

  • 228 . 6

    , -

    Microsoft SQL Server Desktop Engine (MSDE), - Access 2000. SQL Server - SQL Server. MSDE , SQL Server, Microsoft Office 2000. MSDE, Microsoft Office 2000, Enterprise Manager. - MSDE .

    SQL Server ( SQL-) SQL-DMO.

    SQL- SQLDMO. SQLServera. 6.1 .

    // SQLServer2// SQLServer2 - MS SQL ServeroSQLServer2 = ("SQLDMO.SQLServer2");

    (());;

    ;

    oSQLServer2.LoginTimeout = 10;oSQLServer2.ODBCPrefix = 0;

    // SQL-ServerNameList = oSQLServer2.Application.ListAvailableSQLServers(); = 1 ServerNameList.Count (ServerNameList.Item(HoM));

    ;

    // SQL-InstanceNameList = oSQLServer2.Listlnstalledlnstances();

  • SQL-DMO 229

    = 1 InstanceNameList.Count (InstanceNameList.Item()) ;

    ;

    oSQLServera. LoginTimeout , -

    . oSQLServera.ODBCPrefix .

    SQL-DMO, ( 6.2).

    // SQLServer = ("SQLDMO.SQLServer");SQLServer.LoginTimeout = -1;

    = 1 // WinNTSQLServer.LoginSecure = 1;// - SQLServer.AutoReConnect = 0;// SQLServer.Connect();

    // SQL Server SQLServer.LoginSecure = 0;// - SQLServer.AutoReConnect = 0;// SQL SecuritySQLServer.Connect(, (), ());

    ;

    (());;

    ;

  • 230 6

    SQLServer, - SQL-DMO, - . 6.2 , - SQL- NT, . SQL- connect, , - SQL Security, . , SQL-DMO , , -

    SQL-DMO .

    SQLServer.LoginTimeout -1, - 60 . ,

    ( 6.3).

    6.3.

    iCount = 1 SQLServer.Databases.Count // SQLServer.Databases.Item(iCount).SystemObject = 0

    = SQLServer.Databases.Item(iCount);(" :" + .Name);(" :" + .CreateDate);(" :" + .Tables.Count);(" :" + .Views.Count);(" :" + .StoredProcedures.Count);

    ;;

    , -

    , ,

    . SQL-

    .

    ,

    SQLDMO.Tabie, -

  • SQL-DMO 231

    . Table Database.Tables. -, . ,

    item, , - ( 6.4). Database.Tables.Count .

    ........., -

    8.0 "1:".

    // Database = ("SQLDMO.Database");Database = SQLServer.Databases();

    = 1 Database.Tables.Count // Database.Tables.Item().SystemObject = 0 (Database.Tables.Item().Name);

    ;

    ;

    , 6.4, - . Systemobject Table - .

    , ,

    , , , -

    . Table - columns, . , , ,

    ( 6.5).

    // Database = ("SQLDMO.Database");Database = SQLServer.Databases();

    // Table = ("SQLDMO.Table");

  • 232 6

    = 1 Database.Tables.Count // Database.Tables.Item().SystemObject = 0 // = Database.Tables.Item(HoM).Name;(" :" + );

    Table = Database.Tables();// = 1 Table.Columns.Count

    Column = Table.Columns.Item();(" : " + Column.Name);(" : " + Column.DataType);(" : " + Column.Length);(" : " + ?(Column.InPrimaryKey = -1,

    "", ""));(" : " + ?

    (Column.AllowNulls = -1, "", ""));;

    ;

    ;

    6.5 , Tables . Table, , -

    . Columns, PrimaryKey, - . Keys - .

    Column : Name ;

    DataType (,varchar, int . .);

    Length ; InPrimaryKey (-1 ,

    , ); AllowNulls (-1

    , ).

  • SQL- 233

    views Database , . -

    views count, , item, - view () ( 6.6).

    ..........

    // Database = ("SQLDMO.Database");Database = SQLServer.Databases();

    = 1 Database.Views.Count // Database.Views.Itern().SystemObject = 0 (Database.Views.Item(HoM).Name);

    ;

    ;

    .

    , . ,

    , ,

    storedProcedures ( 6.7).

    // Database = ("SQLDMO.Database");Database = SQLServer.Databases();

    = 1 Database.StoredProcedures.Count // Database.StoredProcedures.Item().SystemObject

  • 234 6

    // (Database.StoredProcedures.Itern().Name);

    ;

    ;

    SQL- SQLDMO.Database. :

    SQLDMO.DBFile ; SQLDMO.LogFile .

    .

    NewDB (- 6.8).

    // Database = ("SQLDMO.Database");// DBFileData = ("SQLDMO.DBFile");// LogFile = ("SQLDMO.LogFile");

    // = "NewDB";

    // Database.Name = ;

    // DBFileData.Name = ;

    DBFileData.PhysicalName = SQLServer.Registry.SQLDataRoot + "\DATA\" + + ".mdf";

  • SQL-DMO 235

    DBFileData.PrimaryFile = 1;DBFileData.Size = 2;DBFileData.FileGrowth = 1;

    // Database.FileGroups("PRIMARY").DBFiles.Add(DBFileData);

    // LogFile.Name = + "Log";LogFile.PhysicalName = SQLServer.Registry.SQLDataRoot + "\DATA\" +LogFile.Name + ".Idf";LogFile.Size = 2;

    // Database.TransactionLog.LogFiles.Add(LogFile);

    //

    SQLServer.Databases.Add(Database);

    (());;

    ;

    ,

    Database, DBFiieData LogFile. , Database. FileGroups ("PRIMARY") .DBFiles Database.TransactionLog. LogFiles, .

    .

    DBFile.

    Name .

    PhysicalName .

    PrimaryFile .

    size ( ). FileGrowth , ,

    (, , ). LogFile.

    Name .

  • 236 6

    238 6

    Database.Tables().Remove();

    ;

    // Database.Tables.Add(Table);

    Datatype Length. , 6.9, , Prodio int; ProdName - varchar.

    . 6.1.

    6.1. , SQL-DMO

    bigint

    int

    smallint

    tinyint

    bit

    decimal

    numeric

    money

    smallmoney

    float

    real

    datetime

    smalldatetime

    char

    , -263 (-9 223372 036854 775808) 263 (9 223372 036854 775807) , -231 (-2 147 483 648) 231 (2 147 483 647) , 215 (-32 768) 215 (32 767) , 0 255

    , 0 1

    , -1038 1038

    decimal

    , -263 (-922 337 203 685 477.5808) 263 (+922 337 203 685 477.5807) , -214 748.3648 +214 748.3647

    , -1.79+308 1.79+308

    , -3.40+38 3.40+38

    , 1 1753 31 9999 3.33

    , 1 1900 6 2079 -

    ( Unicode), - 8000

  • SQL-DMO 237

    Table.FileGroup = "PRIMARY";

    //

    // Columnl = ("SQLDMO.Column");Columnl.Name = "ProdID";

    Columnl.Datatype = "int";Table.Columns.Add(Columnl);

    // Column2 = ("SQLDMO.Column");Column2.Name = "ProdName";Column2.DataType = "varchar";Column2.Length = 25;

    Table.Columns.Add(Column2);

    // Columns = ("SQLDMO.Column");Column3.Name = "Price";ColumnS.DataType = "money";Table.Columns.Add(ColumnS);

    // Column4 = ("SQLDMO.Column");Column4.Name = "ProdWeight";Column4.DataType = "decimal";Column4.NumericPrecision = 9;Column4.NumericScale = 5;Table.Columns.Add(Column4);

    // Columnl = "";Column2 = "";

    Columns = "";Column4 = "";

    // // ,

  • 238 6

    Database.Tables().Remove();

    ;

    // Database.Tables.Add(Table);

    Datatype Length. , 6.9, , Prodio int; ProdName - varchar.

    . 6.1.

    6.1. , SQL-DMO

    bigint

    int

    smallint

    tinyint

    bit

    decimal

    numeric

    money

    smallmoney

    float

    real

    datetime

    smalldatetime

    char

    , -263 (-9 223372 036854 775808) 263 (9 223372 036854 775807) , -231 (-2 147 483 648) 231 (2 147 483 647) , 215 (-32 768) 215 (32 767) , 0 255

    , 0 1

    , 1038 1038

    decimal

    , -263 (-922 337 203 685 477.5808) 263 (+922 337 203 685 477.5807) , -214 748.3648 +214 748.3647

    , -1.79+308 1.79+308

    , -3.40+38 3.40+38

    , 1 1753 31 9999 3.33

    , 1 1900 6 2079 -

    ( Unicode), - 8000

  • SQL-DMO 239

    6.1 ()

    varchar

    text

    nchar

    nvarchar

    ntext

    binary

    varbinary

    image

    cursor

    sql_variant

    table

    timestampuniqueidentifier

    ( Unicode), - 8000 ( Unicode), - 231 (2 147 483 647) (Unicode), - 4000 (Unicode), - 4000 (Unicode), - 230 (1 073 741 823) 8000 8000 231 (2 147 483 647)

    , SQL Server , -

    (GUID)

    , -

    .

    .

    ,

    , Name DataType. . ,

    , int, . ,

    varchar, (Name), (DataType) (Length). -

    Add, Columns . Database.Tables.Add . Remove

  • 240 6

    .

    .

    , -

    , , ,

    , ,

    , 6.2. Orders ( 6.10). , -

    identity. 6.9, AiiowNuiis -1.

    // Database = ("SQLDMO.Database");// Table = ("SQLDMO.Table");

    // = "TestDB";

    // = "Orders";

    Database = SQLServer.Databases()Table.Name = ;

    Table.FileGroup = "PRIMARY";

    //

    // Columnl = ("SQLDMO.Column");Columnl.Name = "OrderlD";

    Columnl.Datatype = "int";Columnl.AllowNulls = 0;

    Columnl.Identity = -1;Columnl.IdentitySeed = 1000;Columnl.Identitylncrement = 10;Table.Columns.Add(Columnl);

  • SQL-DMO 241

    // Identity,

    Keyl = ("SQLDMO.Key");Keyl.Name = "OrdersPK";

    Keyl.Type = 1;

    Keyl.Clustered = -1;

    Keyl.KeyColumns.Add(Columnl.Name);Table.Keys.Add(Keyl);

    // datetimeColumn2 = ("SQLDMO.Column");Column2.Name = "OrderDate";

    Column2.DataType = "datetime";

    Table.Columns.Add(Column2);

    // datetime, Column3 = ("SQLDMO.Column");Column3.Name = "ShippedDate";

    ColumnS.DataType = "datetime";

    Columns.AllowNulls = -1;

    Table.Columns.Add(ColumnS);

    // // ,// .

    Database.Tables().Remove();

    ;

    // Database.Tables.Add(Table);

    // Columnl = "";

    Column2 = "";

    ColumnS = "";

  • 242 6

    , 6.10, Orders. orders orderio; orderDate, , shippedDate, . Orderio , ShippedDate NULL. SQL Server - , -

    identity, -1 ( True). , - . identity Keyi Key. - Name Keyi, - . -

    Key . 6.2.

    6.2. SQL-DMO

    SQL-DMOSQLDMOKey ForeignSQLDMOKey Primary

    SQLDMOKey Unique

    3

    12

    ,

    SQLDMOKey_Unknown NULL

    Clustered Keyi -1 ( True). Orders. ! Keys Orders, , -

    .

    Orderio, identity. ( 6.9) ( 6.10) - .

    ShippedDate ( 6.10). - NULL, - . shippedDate , .

    -1 AiiowNuiis, . ( False). Products ( 6.9) orders (- 6.10) "--".

  • SQL-DMO 243

    ,

    , -

    . -

    , . -, -

    Products , . -,

    , Products orders. . ,

    , -

    . , Products Orders, OrderDetails. 6.11 OrderDetails. ,

    Orders Products.

    OrderDetails....

    // Database = ("SQLDMO.Database");// Table = ("SQLDMO.Table");

    // = "TestDB";

    // = "OrderDetails";

    Database = SQLServer.Databases()Table.Name = ;Table.FileGroup = "PRIMARY";

    // .

    // Coluranl = ("SQLDMO.Column");Columnl.Name = "OrderID";Columnl.Datatype = "int";Table.Columns.Add(Columnl);

  • 244 6

    // Column2 = ("SQLDMO.Column");Column2.Name = "ProdID";

    Column2.DataType = "int";Table.Columns.Add(Column2);

    // , OrdersKeyl = ("SQLDMO.Key");Keyl.Name = "OrderIDFK";

    Keyl.Type = 3;

    Keyl.KeyColumns.Add(Columnl.Name);Keyl.ReferencedTable = "Orders";

    Keyl.ReferencedColumns.Add("OrderlD");Table.Keys.Add(Keyl);

    // , Products2 = ("SQLDMO.Key");Key2.Name = "ProdlDFK";

    Key2.Type = 3;

    Key2.KeyColumns.Add(Column2.Name);Key2.ReferencedTable = "Products";

    Key2.ReferencedColumns.Add("ProdID");Table.Keys.Add(Key2);

    // , = ("SQLDMO.Key");.Name = "OrderlDAndProdlDPK";

    .Type = 1;

    .Clustered = -1;

    .KeyColumns.Add(Columnl.Name);.KeyColumns.Add(Column2.Name);Table.Keys.Add();

    // Column3 = ("SQLDMO.Column");Column3.Name = "Quantity";Columns.DataType = "int";

  • SQL-DMO 245

    Table.Columns.Add(ColumnS);

    // // ,// .

    Database.Tables().Remove();

    ;

    // Database.Tables.Add(Table);

    // Columnl = "";Column2 = "";Columns = "";

    , 6.11, , - .

    , , -

    Key. , ( ). - Name Key, , KeyCoiumns. orderio orderDetails . -

    orders Orderio , .

    , , -

    Keys orderDetails. , Prodio Products ProdID OrderDetails. , , , -

    . ,

    .

    ,

    Column. Remove ( ) , Column .

  • 246 6

    SQL- 6.4 , . , Database.Tables, SQL-, - .

    6.12 SQL- - customers, Northwind, - Microsoft SQL Server 7.0/2000...... ,.. _ ...... ....._ ____._,_....,

    6.12. SQL- Customers Northwind

    Database = ("SQLDMO.Database");Database = SQLServer.Databases("Northwind");// (Database.Tables.Item("Customers").Script());

    SQL-, , 6.13.

    ! 6.13. SQL- Customers

    CREATE TABLE [Customers] ([CustomerlD] [nchar] (5) COLLATE Cyrillic_General_CI_AS NOT NULL ,[CompanyName] [nvarchar] ( 4 0 ) COLLATE Cyrillic_General_CI_AS NOT NULL[ContactName] [nvarchar] (30) COLLATE Cyrillic_General_CI_AS NULL ,[ContactTitle] [nvarchar] (30) COLLATE Cyrillic_General_CI_AS NULL ,[Address] [nvarchar] (60) COLLATE Cyrillic_General_CI_AS NULL ,[City] [nvarchar] (15) COLLATE Cyrillic_General_CI_AS NULL ,[Region] [nvarchar] (15) COLLATE Cyrillic_General_CI_AS NULL ,[PostalCode] [nvarchar] (10) COLLATE Cyrillic_General_CI_AS NULL ,[Country] [nvarchar] (15) COLLATE Cyrillic_General_CI_AS NULL ,[Phone] [nvarchar] (24) COLLATE Cyrillic_General_CI_AS NULL ,[Fax] [nvarchar] ( 2 4 ) COLLATE Cyrillic_General_CI_AS NULL ,

    CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED(

    [CustomerlD]) ON [PRIMARY]

    ) ON [PRIMARY]GO

  • SQL-DMO 247

    6.12 , , 6.4, . script . 6.14 SQL- , :

    ;

    ;

    ;

    ;

    .

    6.14,

    Database = ("SQLDMO.Database");Database = SQLServer.Databases(); = "";

    // = 1 Database.Tables.Count

    = + Database.Tables.Item().Script();;

    // = 1 Database.Views.Count = + Database.Views.Item(HoM).Script();

    ;

    // = 1 Database.StoredProcedures.Count

    = + Data-base .StoredProcedures.Item().Script();

    ;

    // =1 Database.Users.Count = + Database.Users.Item().Script();

    ;

  • 248 6

    /I = 1 Database.DatabaseRoles.Count

    = +Database.DatabaseRoles.Item().Script();.

    ;

    = ("");.();.(" ",);

    (());;

    ;

    SQL- SQL-DMO, , SQL-. ExecuteWithResults Database. ExecuteWithResults SQL- QueryResults. QueryResults. ROWS ; Columns -

    ;

    CoiumnType () ( . 6.3);

    coiumnName () .

    6.3. QueryResults

    SQL-DMOSQLDMO DTypeBigint

    SQLDMO DTypeBinary

    SQLDMO_DTypeBit

    SQLDMO DTypeChar

    -5

    -2

    -7

    1

    bigint

  • SQL-DMO 249

    6.3 () SQL-DMOSQLDMO DTypeDateTime

    SQLDMO DTypeDateTime4

    SQLDMO_DTypeFloat4

    SQLDMO_DTypeFloat8

    SQLDMO_DTypeGUID

    SQLDMO DType ImageSQLDMO DTypelntlSQLDMO_DTypeInt2SQLDMO_DTypeInt4SQLDMO DTypeMoneySQLDMO DTypeMoney4SQLDMO_DTypeNTextSQLDMO DtypeSQLVariant

    -2

    93

    7

    8

    -11

    -4

    -6

    5

    4

    3

    3

    -10

    -150

    ODBC SQL TIMESTAMP STRUCT ODBC SQL TIMESTAMP STRUCT

    (4 )

    (8 )

    (GUID)

    (1 ) (2 ) (4 )

    (Unicode) , SQL

    SQLDMO_DTypeText -1

    SQLDMO_DTypeUChar -8

    SQLDMO_DTypeUnknown 0

    SQLDMO_DTypeUVarchar -9

    SQLDMO_DTypeVarBinary -3

    SQLDMO_DTypeVarchar 12

    Server

    (Unicode)

    (Unicode)

    GetColumnString QueryResults , .

    GetCoiumnstring - (). 6.15 SQL- - .

  • 250 6

    = "Northwind";

    = "SELECT * FROM Customers";

    3_3 = ("");

    (" ...");QueryResults = SQLServer.Databases().ExecuteWithResults

    ();

    (" ...");// , = 1 QueryResults.Rows = 1

    // ,// = 1 QueryResults.Columns // 3_3.(QueryResults.ColumnName(), , "",,,QueryResults.ColumnName (),15,) ;

    ;

    ;

    // 3_3.();// = 1 QueryResults.Columns _.(, ,QueryResults.GetColumnString(,));

    ;

    ;

    // 3_3.();

    (());;

    ;

  • SQL-DMO 251

    , . .

    , -

    .

    ROWS, columns CoiumnName QueryResuits. QueryResuits - , .

    , , -

    :

    1. ExecuteWithResults Database - QueryResuits, .

    2. QueryResuits, CoiumnName - ,

    . columns.3. QueryResuits. -

    ROWS.4. QueryResuits,

    Getcoiumnstring - .

    Backup. .

    Action , , ( - . 6.4);

    Database ; Files ; MediaName ,

    ;

    BackupSetDescription ; BackupSetName . SQLBackup Backup - , SQLServer.

  • 252

    6.4. Action Backup

    SQL-DMO SQLDMOBackup_Database SQLDMOBackup_Files 2

    SQLDMOBackup_Incremental I

    SQLDMOBackup_Log

    ,

    . . ,

    -

    -

    6.16 Northwind C:\BACKUP\Northwind.bak.

    ! 6.16. Northwind

    Backup = ("SQLDMO.Backup");Backup.Action = 0;Backup.Database = "Northwind";Backup.Files = "C:\BACKUP\Northwind.bak";Backup.MediaName = "Northwind.bak " + () + " " +();Backup.BackupSetName = "Northwind";Backup.BackupSetDescr-iption = " ";Backup.SQLBackup(SQLServer);

    Restore.

    .

    Action ( . 6.5);

    Database , ; Files ; FiieNumber ; RepiaceDatabase

    ( -1 ); LastRestore -

    ( -1 ).

  • SQL-DMO 253

    6.5. Action Restore

    SQL-DMO SQLDMORestore_Database 0 SQLDMORestore_Files 1

    SQLDMORestore_Log 2 -

    6.17 Northwind C:\BACKUP\Northwind.bak.-"^ ~"^ ~"-"" ~~" " ":v"~ "-~-r-'~-"" -,| 6.17. Northwind jRestore = ("SQLDMO.Restore");Restore.Action = 0;Restore.Database = "Northwind";Restore.Files = "C:\BACKUP\Northwind.bak",-Restore.FileNuraber = 1;Restore.ReplaceDatabase = -1;Restore.LastRestore = -1;Restore.SQLRestore(SQLServer);

    SQL-DMO :

    Login SQL-;

    DatabaseRole ; user .

    Login - SQL Server . Login .

    CD Name " \ "; (

    . 6.6); DenyNTLogin Windows NT .

  • 254 6

    ^

    DenyNTLogin -1 (), Windows NT SQL- . - 0 () Windows NT .

    6.6. Login

    SQL-DMO SQLDMOLogin_NTGroup

    SQLDMOLogin_NTUser

    SQLDMOLogin_Standard 2

    SQL Server ,

    Windows

    SQL Server , Windows

    SQL Server

    6.18 SQL Server "MAVcoMP\mav" Windows NT .

    6.18.

    Login = ("SQLDMO. Login" ) ;Login. Name = " MAVCOMP \rnav ";Login. Type = 1;SQLServer. Logins. Add(Login) ;

    ,

    Add Logins SQLServer. 2 (SQLDMOLogin_standard), - setPassword. :

    Login. SetPassword (" ", " ") .

    ] ,

    .

    SQL- SQL-DMO Remove User. - :

    SQLServer . Logins ( "MAVCOMPXmav" ) . Remove ( ) .

  • SQL-DMO 255

    DatabaseRoie. - . Microsoft SQL Server - , . 6.7.

    6.7. Microsoft SQL Server

    Db_owner

    Db_accessadmin

    Db_datareader

    Db_datawriter

    Db_ddladmin

    Db_securityadmin

    Db_backupoperatorBacks up the database

    Db_denydatareader

    Db_denydatawriter

    DDL (Data Definition Language )

    , -

    SQL- (Application Roles), SQL-DMO - DatabaseRoie.

    DatabaseRoie.

    Name .

    AppRole . - -1 () ().

    -1 (), Password.

    Password .

    6.19 .

  • 256 6- --v------."--:-- 7" " " ". " -- ..--, -----,,. .-.

    1 6.19. Nor thwind

    DbRole = Co3flaTbO6beKT("SQLDMO.DatabaseRole");DbRole.Narae = "AppRole";DbRole.AppRole = -1;

    DbRole.Password = "erpg_ru";

    SQLServer.Databases("Northwind").DatabaseRoles.Add(DbRole);

    Add DatabaseRoles Database. Remove DatabaseRoie. :

    SQLServer.Databases("Northwind") .DatabaseRoles("AppRole") .Remove() . SQL-DMO user. user :

    Name ; Login SQL Server; Role . 6.20 "MAV" Northwind.

    6.20. Northwind

    DbUser = Co3flaTb06beKT("SQLDMO.User");DbUser.Name = "MAV";

    DbUser.Login = "MAVCOMP\mav";SQLServer.Databases("Northwind").Users.Add(DbUser);

    Remove user.

    :

    SQLServer. Databases("Northwind"). Users("MAV"). Remove().

    , -

    Grant . , , -

    .

    6.21 "MAV".

  • SQL-DMO 257

    6.21. "MAV" Northwind |Database = SQLServer.Databases("Northwind");// NorthwindDatabase.Grant(128, "MAV");// CustomersDatabase.Tables("Customers").Grant(63, "MAV");// InvoicesDatabase.Views("Invoices").Grant(63, "MAV");// CustOrdersOrdersDatabase.StoredProcedures("CustOrdersOrders").Grant(16, "MAV");

    Customers, invoices, CustOrdersOrders Northwind. customers "MAV" . 6.1.

    Object Properties - NorthwindRemissions

    fi> Object: Customers (dbo)

    jList all users/user-defined database toles/'publicjList only users/user-defined database toles/public with permissions on this object.

    Users/Database Roles/Public i SELECT

    E

    MAVguest Qpublic 5f

    j INSERT IUPDATE iDELETE ^EXEC JDRIk ;,..;*;'* \ E

    is'"[1 rj . ["]*j^ *" -Hj^ jf

    T5CJ oPj Iifj

    Columns...

    OK

    . 6.1. Customers

    9 . 722

  • 258 6

    , 6.21, Grant :

    ;

    .

    .

    . 6.8 Grant Database.

    SQL-DMO

    6.8. Da tabase

    SQLDMOPriv AllDatabasePrivs 130944

    SQLDMOPriv CreateDatabase 256

    SQLDMOPriv CreateDefault 4096

    -

    -

    default - CREATEDEFAULT

    SQLDMOPriv CreateFunction

    SQLDMOPriv CreateProcedure

    SQLDMOPriv_CreateRule

    SQLDMOPriv_CreateTable

    SQLDMOPriv CreateView

    SQLDMOPriv_DumpDatabase

    SQLDMOPriv_DumpTable

    SQLDMOPriv DumpTransaction

    65366

    1024

    16384

    128

    512

    2 0 4 8

    3 2 7 6 8

    8192

    -

    -

    SQL-DMO

    . 6.9 Table View.

  • SQL-DMO 259

    SQL-DMO

    6.9. Table View

    SQLDMOPriv_A110bjectPrivs 63

    SQLDMOPriv Delete

    SQLDMOPriv Insert

    SQLDMOPriv References

    SQLDMOPriv Select

    SQLDMOPriv Update

    32

    -

    -

    -

    DELETE

    -

    INSERT

    -

    SELECT

    -

    UPDATE

    . 6.10 StoredProcedure.

    6.10. StoredProcedure

    SQL-DMO

    SQLDMOPriv_A110bjectPrivs 63

    SQLDMOPriv Execute 16

    -

    -

    SQL-DMO, - Revoke, Grant.

    6.22 , - ( 6.21) .

  • 260 6

    I 6.22. i Northwind

    '--

    Database = SQLServer.Databases("Northwind");// NorthwindDatabase.Revoke(128, "MAV");// CustomersDatabase.Tables("Customers").Revoke(63, "MAV");// InvoicesDatabase.Views("Invoices").Revoke(63, "MAV");// CustOrdersOrdersDatabase.StoredProcedures("CustOrdersOrders").Revoke(16, "MAV")

  • 7

    Windows, rundl!32

    rundl!32Microsoft Windows Rundll32.exe, , DLL-.

    -

    Microsoft.

    . , Rundll32.exe, . .

    "1:" , - . ,

    :

    ("RunDLL32.EXE shel!32.dll,Control_RunDLL"). rundll32 -.

    , , , -

    , .

    . ,

    , -

    .

    .

  • 262 7

    rundl!32 . , , Controi_RunDLL shell32.dll. . 7.1 , .

    7.1. rundl!32,

    - RunDLL32. EXE . shel!32. dll, Control_

    RunDLL access.cpl,,3

    Windows 95/98/ME/NT4/2000/XP/2003 - RunDLL32. EXE . she!132.dll,Control_

    RunDLL access.cpl,,5

    Windows 95/98/ME/NT4/2000/XP/2003 - RunDLL32. EXE . shell32.dll,Control__ RunDLL access.cpl,,1

    Windows 95/98/ME/NT4/2000/XP/2003 - RunDLL32. EXE . shel!32.dll,Control_ RunDLL access.cpl,,4

    Windows 95/98/ME/NT4/2000/XP/2003 - RunDLL32. EXE . shel!32 . dll, Control__ RunDLL access.cpl,,2

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE shel!32 .dll, Control_. RunDLL appwiz.cpl , ,0 Windows XP/2003 RunDLL32. EXE she!132.dll,Control_. RunDLL appwi z. cpl,, 1

    Windows 95/98/ME/NT4/2000/XP/2003

  • Windows, rundl!32 263

    7.1 ()

    RunDLL32. EXE Shell32.dll, Control_. RunDLL appwiz.cpl,,3

    Windows XP RunDLL32. EXE - shel!32. dll, Control_ Windows. RunDLL appwi z. cpl,, 2

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE. shel!32 .dll,Control_

    FillCache RunDLL

    Windows 95/98/ME/NT4/2000/XP/2003 . RunDLL32.EXE

    shell32.dll,control_ Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE. shel!32.dll,Control_ Windows 95/98/ME/NT4/2000/XP J*unDLL desk ?1 2

    . RunDLL32. EXE Windows 95/98/ME/NT4/2000/XP ^he:[;T1^2-d1?-' ^1:1-RunDLL desk.cpl,, 0 RunDLL32. EXE. she!132.dll,Control_

    RunDLL desk.cpl,,1

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE. shel!32.dll,Control_

    RunDLL desk.cpl,,3

    Windows 95/98/ME/NT4/2000/XP/2003 . RunDLL32. EXE Windows 2003

    . RunDLL32. EXE.,.-. shell32.dll,Control

    Windows XP RunDLL degk' cpl/ f _

    . RunDLL32 . EXESHELL32.DLL,SHHelpShortcuts

    Sows 95/98/ME/NT4/2000/XP/2003 RunDLL

  • 264 7

    7.1 ()

    . RunDLL32 . EXEshel!32.dll,Control_

    Windows 95/98/ME RunDLL main, cpl @3 RunDLL32 . EXE . shell32.dll,Control_... RunDLL joy . cpl

    Windows 95/98/ME/NT4/2000/XP/2003 - RunDLL32 . EXE . shell32.dll,Control_ Windows 95/98/ME/NT/2000/XP RunDLL ***-1 . RunDLL32.EXE devmgr.dll Windows 2000/XP/2003 DeviceManager_Execute

    . RunDLL32 . EXE shell32.dll,Control_ Windows 95/98/ME/NT4/2000/XP/2003 :cpl. cpl,, tt

    RunDLL32. EXE . shel!32. dll, Control_... RunDLL inetcpl. cpl, ,

    Windows 95/98/M E/NT4/2000/XP/2003 RunDLL32. EXE . shel!32. dll, Control_ Windows NT4/2000/XP/2003 unDLL ^etcPl >1,, 2 RunDLL32. EXE . shell32.dll,Control_ Windows NT4/2000/XP/2003 RunDLL inetcPl -!"1

    RunDLL32. EXE . shell32.dll,Control_ Windows 2000/XP/2003 RunDLL main'cpl @ l'l

    RunDLL32. EXE she!132.dll,Control_ Windows 2000/XP/2003 RunDLL main'cpl @ ' RunDLL32. EXE . SHELL32. DLL, Control_,-, RunDLL modem, cpl, , add Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32 . EXE

    shel!32.dll,Control_RunDLL modem.cplRunDLL32.EXESysDM.cpl,InstallDeviceRunDLL Modem

  • Windows, rundl!32 265

    7.1 ()

    RunDLL32.EXE . shell32. dll, Control_n I A I - -i onnn/vr>/r,,-.r,'1 RunDLL main.cpl @ 0 , 0 Windows 2000/XP/2003 RunDLL32. EXE . shel!32.dll, Control_ vr,/or./-.o RunDLL main.cpl @0, 4 Windows XP/2003 RunDLL32. EXE . shel!32 . dll, Control_ \/1-,//->> RunDLL main.cpl @ 0 , 2 Windows XP/2003 RunDLL3 2. EXE . shel!32 . dll, Control_

    ///^ RunDLL main.cpl @0,1 Windows XP/2003 RunDLLS 2. EXE . shel!32 . dll, Control_

    x/i-1/., RunDLL main.cpl @ 0 , 3 Windows XP/2003 RunDLLS 2. EXE . shel!32.dll,Control_ Windows 95/98/ME/NT4/2000 RunDLL mmsys. cpl,,

    RunDLL32. EXE CD-ROM. shell32 . dll, Control_

    -_._...._...._.. RunDLL mmsys.cpl , ,3 Windows 95/98/ME/NT4 RunDLL32. EXE . she 1132 .dll, Control_

    ,-/. RunDLL mmsys. cpl,, 4 Windows 95/98/ME/NT4 RunDLL32. EXE MIDI. shell32.dll,Control_

    _,.,__ ,..-

    RunDLL mmsys. cpl,, 2 Windows 95/98/ME/NT4 RunDLL32. EXE . shell32.dll,Control_ Windows 95/98/ME/NT4/2000 lsys' ]

    . RunDLL32. EXE-/,,/- shel!32 .dll, Control

    Windows 95/98/ME RunDLL netc^ cpl

    ODBC RunDLL32. EXE . shel!32.dll,Control_

    RunDLL odbccp32.cpl

    Windows 95/98/ME/NT4/2000/XP/2003

  • 266 7

    7.1 ()

    . RunDLL32 . EXE Windows 95/98/ME fe^T

    32 ' dH- Control

    RunDLL password.cpl

    PCMCIA. RunDLLS2 . EXE Windows 95/98/ME

    RunDLLS2 . EXE . 132.dll, Control_ Windows 95/98/ME/NT4/2000/XP RunDLLS2. EXE . shel!32 . dll, Control^ Windows NT4/2000/XP lunDLL UPS-C^1

    RunDLL32. EXE . shell32. dll, Control__ RunDLL intl .cpl,,2

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLLS2. EXE . shell32.dll, Control^ Windows 95/98/ME/NT4/2000 unDLL intl'cpl" 4

    RunDLLS2. EXE . shell32.dll,Control_ Windows 95/98/ME/NT4/2000 RunDLL intl. cpl, ,

    RunDLL32. EXE . shell32 .dll,Control_ Windows 95/98/ME/NT4/2000 RunDLL intl. cpl,, 5

    RunDLLS2. EXE . shel!32.dll,Control_

    RunDLL ^1. cpl,, 1

    Windows 95/98/ME/NT4/2000XP/2003

    RunDLLS2. EXE . shel!32.dll,Control_ Windows 95/98/ME/NT4/2000 RunDLL intl. cpl,, 3

    . RunDLLS2. EXE Windows 95/98/ME/NT4 shel!32 .dll, Control

    RunDLL mmsys.cpl @1

    RunDLLS 2. EXE . shel!32.dll,Control_ Windows XP/2003 RunDLL =s. cpl,, 2

  • Windows, rundl!32 267

    7.1 ()

    RunDLL32. EXE . shell32 . dll, Control__ wn/^ RunDLL ramsys.cpl,,4 Windows XP/2003 RunDLL32. EXE . shel!32.dll,Control_ ..,- -i \fi-4nnnn RunDLL mmsys.cpl, , ! Windows XP/2003 RunDLL32. EXE . shel!32.dll,Control^

    /,/^ RunDLL mmsys.cpl,, 3 Windows XP/2003 RunDLL32. EXE . shel!32. dll, Control_

    RunDLL m m s y s . c p l , , Windows XP/200 RunDLL32.EXE . shel!32 .dll, Control_

    RunDLL sysdm.cpl,,3 Windows XP/2003 RunDLL32. EXE . shel!32.dll,Control_

    RunDLL sysdm.cpl, ,4 Windows XP/2003 RunDLL32. EXE . shel!32. dll, Control_

    RunDLL sysdm.cpl,,5 Windows XP RunDLL32. EXE . shel!32. dll, Control_

    RunDLL sysdm.cpl,,! Windows XP/2003 RunDLL3 2. EXE . shel!32. dll, Control_

    RunDLL sysdm.cpl,,

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE . shel!32. dll, Control Windows NT4/2000/XP/2003 RunDLL32. EXE . shel!32. dll, Control_

    RunDLL sysdm.cpl,,! Windows NT4/2000 RunDLL32 . EXE . shel!32. dll, Control_

    RunDLL sysdm.cpl,, Windows XP

  • 268 7

    7.1 ()

    RunDLL32. EXE . shel!32 .dll, Control_

    RunDLL sysdm.cpl,,5 Windows 2003

    RunDLL32. EXE . shel!32.dll, Control_

    //-> RunDLL sysdm.cpl , ,4 Windows 2000/XP

    RunDLL32. EXE . shel!32 .dll, Control_ Windows 95/98/ME/NT4/2000/XP RunDLL sysdm. cpl,, 3

    . RunDLL32. EXE shell32.dll,Control_ Windows 95/98/ME/NT4/2000/XP/2003 Lephn' cpl

    Windows 95/98 RunDLL32. EXE Windows Plus. shel!32 . dll,Control_

    RunDLL themes.cpl Windows 95/98/ME

    . RunDLL32. EXE shell32.dll,Control_ Windows 95/98/ME/NT4/2000/XP/2003 RunDLL ^f^ ^

    RunDLL32. EXE . shell32.dll,Control__ RunDLL timedate.cpl,,/f

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE . she!132.dll,Control_ Windows NT4/2000/XP/2003 RunDLL ncpa. cpl

    . 7.1, , .

    Controi_RunDLL, , .

    , ,

    .

    7.1 .

  • Windows, rundl!32 269

    i...J

    // " " ""("RunDLL32.EXE shel!32.dll,Control_RunDLLsysdm.cpl,, 4") ;// " " ("RunDLL32. shell32.dll,Control_RunDLL sysdm.cpl");// " "("RunDLL32.EXE shel!32.dll,Control_RunDLLtimedate.cpl");// " " " "("RunDLL32.EXE shel!32.dll,Control^RunDLL timedate.cpl,,/f");// " "("RunDLL32.EXE shell32.dll,Control_RunDLL main.cpl// ""("RunDLL32.EXE shel!32.dll,Control_RunDLL main.cpl

    @0") ;

    01") ;

    Microsoft Windows - , , -

    , Dial-Up , . -

    , .

    . 7.2 .

    7.2. rundl!32,

    .

    Windows XPRunDLL32.EXEFLDRCLNR.DLL,Wizard RunDLL

    Dial-Up-.

    Windows 95/98/ME/NT4/2000XP

    .

    Windows 95/98/ME/XP

    RunDLL32.EXERNAUI.DLL,RnaWizard

    RunDLL32.EXESysDM.cpl,InstallDevice_RunDLL ImageRunDLL32.EXEwiashext.dll,AddDeviceWasChosen

  • 270 7

    7.2 ()

    .

    Windows 2000/XP/2003

    .

    Windows 95/98/ME

    .

    Windows NT4/2000/XP/2003 .

    Windows 2000

    .

    Windows XP

    .

    Windows XP/2003 .

    Windows 95/98/ME/NT4/2000/XP

    RunDLL32.EXEnetplwiz.dll,AddNetPlaceRunDll

    RunDLL32.EXEUSER.DLL,wnetconnectdialog

    RunDLL32.EXEshel!32.dll,SHHelpShortcuts_RunDLL Connect

    RunDLL32.EXEnetplwiz.dll,NetAccWizRunDll

    RunDLL32.EXE hnet-wiz.dll,HomeNetWizardRunDll

    RunDLL32.EXE net-shell.dll, StartNCW

    RunDLL32.EXESHELL32.DLL,SHHelpShortcuts_RunDLL AddPrinter

    RunDLL32.EXE RunDLL32.SysDM.cpl,InstallDevice_RunDLL Printer,,0

    TCP/IP- . Windows 2000

    RunDLL32.EXE tcpmo-nui.dll,LocalAddPortUI

    7.2 -.

    // Dial-Up-("RunDLL32.EXE RNAUI.DLL,RnaWizard"};// ("RunDLL32.EXE netshell.dll,StartNCW");// ("RunDLL32.EXE SHELL32.DLL,SHHelpShortcutsRunDLL AddPrinter");

  • Windows, rundl!32 271

    Microsoft Windows - , -

    rund!132.

    . 7.3 , -.

    7.3. rundll32, -

    Dial-Up-, ,

    ConnectionName.

    RunDLL32.EXERnaui.dll,RnaDialConnectionName

    Windows 95/98/ME/NT4/2000/XP -, RunDLL32. EXE %1 CDF. cdfview.dll,openChannel %1

    Windows 95/98/ME/NT4/2000/XP/2003 Internet Explorer - RunDLL32. EXE HotMail. "%ProgramFiles%\

    Internet ExplorerN hmmapi.dll",OpenInboxHandler Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE setupwbv. dll,Internet Explorer. Internet lESMaintenance "C:\Explorer 5 6. Program FilesUnternet Windows 95/98/ME/NT4/2000/XP sETUp!EXE"e/gP"%SystemRoot%\

    IE Uninstall Log.Txt"

    - RunDLL32. EXE-, - - cdfview. dll, Subscribe %1 %1.

    Windows 95/98/ME/NT4/2000/XP/2003 , - RunDLL32. EXE url. dll, %1. MailToProtocolHandler %1 ,

    .

    Windows 95/98/ME/NT4/2000/XP/2003 , RunDLL32.EXE url .dl l , %1. NewsProtocolHandler %1

    Windows 95/98/ME/NT4/2000/XP/2003

  • 272 7

    7.3 ()

    - , RunDLL32.EXE url .dll, % l . FileProtocolHandler %1

    Windows 95/98/ME/NT4/2000/XP/2003

    HTML- RunDLL32.EXE mshtml.dll, HtmlFileNameAndPath. PrintHTML

    "HtmlFileNameAndPath"

    Windows 95/98/ME/NT4/2000/XP/2003

    Telnet-, RunDLL32. EXE ur i . dll, %l. TelnetProtocolHandler %1

    Windows 95/98/ME/NT4/2000/XP/2003

    7.3 -.

    : 7.3.

    // ("RunDLL32.EXE url.dll,MailToProtocolHandlermav@erpg.ru");// - ("RunDLL32.EXE url.dll,FileProtocolHandlerwww.erpg.ru");// ("RunDLL32.EXE mshtml.dll, PrintHTML""http://forum.erpg.ru""");

    rundl!32 . :

    rund!132 printui.dll,PrintUIEntry [] [@ ].

    ^

    Windows 2000/XP/2003.

  • Windows, rundl!32 273

    .

    / [] ; /[] ; / [] UNC- , ; /dl ; /dn ; /dd ; / ; /[] ; / ; / ; /gd ; /h[apx] Alpha|Intel|Mips|PowerPC; /la ; /id -

    ;

    /i f ; /ii

    ;

    /ii ; /in ; /j [] ; /k ( -

    ); /I [] ; / [ ] ; / [ ] ; / ; / ; /q ; / [] ; /s ; /ss ;

    . 722

  • 274 7

    /sr , , - -

    , :

    ;

    d ; s ;

    g ; m ;

    ;,

    ;

    f ; ;

    / , ; /t [] ( ); /v[] ; /w , INF-; / - ; / ; / ; /z ; /z , / i f . .

    7.4 .

    f : " -----,-,~--~~-------. ....-.- ---------- - -- - - -------: 7.4.

    // ("rundl!32 printui.dll,PrintUIEntry /s /tl/n\\machine");// ("rundl!32 printui.dll,PrintUIEntry /p/n\\machine\printer");// ("rundl!32 printui.dll,PrintUIEntry /il");// \\machine("rundl!32 printui.dll,PrintUIEntry /il /c\\machine'

  • Windows, rundl!32 275

    // ("rundll32 printui.dll,PrintUIEntry //n\\machine\printer") ;// ("rundl!32 printui.dll,PrintUIEntry /if /b ""Test Printer"" /f %windir%\inf\ntprint.inf /r ""Iptl:"" /m ""AGFA-AccuSet v52.3""");// ("rundl!32 printui.dll,PrintUIEntry /ii/f %windir%\inf\ntprint.inf");// ("rund!132 printui.dll,PrintUIEntry /ga /c\\machine/n\\machine\printer /j""LanMan Print Services""");// ("rundl!32 printui.dll,PrintUIEntry /gd /c\\machine/n\\machine\printer");// ("rundl!32 printui.dll,PrintUIEntry /ge /c\\machine");// ("rundl!32 printui.dll,PrintUIEntry /ia /c\\machine /m""AGFA-AccuSet v52.3"" /h ""Intel"" /v ""Windows 2000"" /f %win-dir%\inf\ntprint.inf");// ("rundl!32 printui.dll,PrintUIEntry /dd /c\\machine /m""AGFA-AccuSet v52.3"" /h ""Intel"" /v ""Windows 2000""");// ("rundl!32 printui.dll,PrintUIEntry / /n""printer""");// ("rundl!32 printui.dll,PrintUIEntry /Xs /n ""printer""comment ""My Cool Printer );// ("rundl!32 printui.dll,PrintUIEntry /Xg /n""printer""");// ("rundl!32 printui.dll,PrintUIEntry /f ""results.txt""/Xg /n ""printer""");// :("rundl!32 printui.dll,PrintUIEntry /Xs /n ""printer""?");// ("rundl!32 printui.dll,PrintUIEntry /Ss /n ""printer""/a ""file.dat""");

  • 276 7

    II ("11132 printui.dll,PrintUI /Sr /n ""printer"" /a""file.dat""");// 2 ("

  • Windows, rundl!32 277

    7.4 ()

    .

    Windows NT4RunDLL32.EXEshel!32.dll,Control_RunDLL ports.cpl

    . - RunDLL32. EXE: DESKCP16.DLL,QUICKRES_

    RUNDLLENTRY HxVxR , -

    , 640, 800 . .;V , ,480, 600 . .;R , ,8 (256 ), 16, 32 . . Windows 95/98/ME . RunDLL32. EXE DISKCOPY.DLL,DiskCopyRunDll

    Windows 95/98/ME/NT4/2000/XP RunDLL32. EXE. SHELL32.DLL,SHFormatDrive

    Windows 95/98/ME/NT4/2000/XP () . RunDLL32 ..EXE Windows 95/98/ME USER. DLL, repaintscreen

    DUN-. RunDLL32. EXE Windows 95/98/ME rnaserv.dll,CallerAccess

    RunDLL32. EXE( ). shel!32.dll,Control_ RunDLL findfast.cpl

    Windows 95/98/ME/NT4/2000/XP RunDLL32. EXEFileName. SHELL32.DLL,OpenAs_

    RunDLL FileName

    Windows 95/98/ME/NT4/2000/XP/2003 RunDLL32. EXE . shel!32. dll, Control Windows 2000/XP/2003 RunDLL htplug'd:

    . RunDLL32. EXE_ shdocvw.dll,DoOrganizeFavDlg

    Windows 95/98/ME/NT4/2000/XP/2003

  • 278 7

    7.4 ()

    . RunDLL32.EXE KEYBOARD, disable Windows 95/98/ME

    Microsoft Exchange . RunDLL32 .EXEflocTy^W^dowsQ^e/ME Microsoft Postoffice Workgroup RunDLL32. EXEAdmin shell32.dll,Control_ Windows 95/98/ME RunDLL 9Pcpl c?1 ~

    . RunDLL32.EXE USER.DLL, Value SetDoubleClickTime Value .

    Windows 95/98/ME

    . RunDLL32. EXE Windows 95/98/ME USER DLL' SwapMouseButton

    . RunDLL32. EXE Windows NT4 USER32' DLL' SwapMouseButton

    RunDLL32.EXE USER.DLL, . wnetdisconnectdialog Windows 95/98/ME RunDLL32.EXE shell32.dll, . SHHelpShortcuts_ Windows NT4/2000/XP/2003 RunDLL Disconnect

    " RunDLL32 . EXE". shell32.dll,Control_ Windows NT4 RunDLL srvmgr'cpl

    RunDLL32. EXE. NTLANUI.DLL,ShareCreate Windows NT4/2000/XP/2003 . RunDLL32. EXE Windows NT4/2000/XP/2003 NTLANUI. DLL, ShareManage

    RunDLL32.EXE A p p W i z . C p l ,, %1. NewLinkHere %1

    Windows 95/98/ME/NT4/2000/XP/2003 TweakUl, RunDLL32. EXE . shell32.dll, Control_RunDLL Windows 95/98/ME/NT4 tweakui . cpl

  • Windows, rundl!32 279

    7.4 ()

    , -

    %1, - .

    Windows XP/2003

    RunDLL32.EXE %SystemRoot%\System32\shimgvw.dll,ImageView_Fullscreen %1

    .

    Windows 2000/XP/2003RunDLL32.EXE SHELL32.DLL,ShellAboutWRunDLL32.EXE SHELL32.DLL,ShellAboutA

    -

    .

    Windows 95/98/ME

    ,

    %1, -.

    Windows 2000/XP/2003

    RunDLL32.EXE SHELL.DLL,RestartDialog

    RunDLL32.EXE shell32.dll,ShellExec RunDLL %1

    -

    , -

    ++. Windows 2000/XP/2003

    RunDLL32.EXE user32.dll,LockWorkStation

    7.5 rund!132.

    // boot.ini("RunDLL32.EXE SHELL32.DLL,OpenAs_RunDLL:\boot.ini");// " "("RunDLL32.EXE shel!32.dll,Control_RunDLL hot-plug, dll");// ("RunDLL32.EXE %SystemRoot%\System32\shimgvw.dll,ImageView_Fullscreen :\picture.jpg");// booklc.doc DOC- ("RunDLL32.EXE shel!32.dll,ShellExec_RunDLLc:\booklc.doc");// ("RunDLL32.EXE user32.dll,LockWorkStation");

  • 8

    -

    - -

    -

    .

    , ,

    , .

    , -

    , , -

    .

    () , TCP/IP (Transmission Control Protocol/Internet Protocol ). TCP- - SMTP (Simple Mail Transfer Protocol). -

    (Post Office Protocol 3). "1:" SMTP . -

    ( , ).

    mailto -

    ,

    ,

    mailto: ( 8.1).

  • 282 8

    I/ // "", "" " ".("mailto:mav@erpg.ru;boss@erpg.ru?subject=%20&1=!%%20.");// ("mailto:mav@erpg.ru");// "" " "

    ("mailto:mav@erpg.ru?subject=npMMep%20TeMbi&cc=erpgSerpg.ru&bcc=boss@erpg.ru");

    maiito:mailto:?subject=&cc=&bcc=?&body= . :

    subject () ; ,

    , ;

    ,

    , ;

    body .

    , , maiito:, . %20, %0d.

    MAPI -

    , , Microsoft , MAPI (Messaging Application Program Interface). MAPI MAPI, -

    , , -

    . . ,

    Microsoft Windows, MAPI. , MAPI - , , -

  • - 283

    , -

    "1:", . -

    , MAPI , - , -

    . ,

    , , MAPI( ), MAPI- ,

    , . -

    , ,

    "" . ,

    . , .

    , MAPI -

    . ,

    .

    ,

    ,

    .

    ( ). Microsoft MSMAPI32.OCX, - ActiveX, MAPI , OLE-.ActiveX : MAPisession MAPiMessage. MApisession - .

    -

    , , , . MAPiMessages - .

    "1C:". 7.7 , 8.0 .

    () signdn MAPisession, MAPiMessages, 6 MAPISession ( 8.2). signoff MAPisession.

    . MAPI. : : :

    // SessionSessionCtrl = ("MSMAPI.MAPISession")// Messages

  • 284 8

    MessageCtrl = ("MSMAPI.MAPIMessages");// SessionCtrl.UserName = "MyName";// SessionCtrl.Password = "MyPassword";// SessionCtrl.SignOn();// , MessageCtrl.SessionID = SessionCtrl.SessionID;// ...// SessionCtrl.SignOff();

    UserName Password MAPISession ,

    Microsoft Mail. Microsoft Outlook, ,

    , .

    Fetch, - MAPiMessages. - MessageCtrl , Msgindex. 8.3 , .

    // SessionSessionCtrl = ("MSMAPI.MAPISession");// MessagesMessageCtrl = ("MSMAPI.MAPIMessages");// SessionCtrl.SignOn();// , MessageCtrl.SessionID = SessionCtrl.SessionID;.

    // .// ,// FetchUnreadOnly -1 ()

  • - 265

    MessageCtrl.FetchUnreadOnly =0; // // MessageCtrl.Fetch(); = 0 MessageCtrl.MsgCount - 1

    // MessageCtrl.Msglndex = ;// = ": " + MessageCtrl.MsgSubject + ": " +MessageCtrl.MsgNoteText;

    ();;

    // SessionCtrl.SignOff();

    . MsgSubject MsgNoteText MAPIMessages .

    , . ,

    MsgOrigDisplayName MsgOrigAddress , MsgDateReceived . MAPIMessages. - , ,

    ( 8.4).

    // SessionSessionCtrl = ("MSMAPI.MAPISession");// MessagesMessageCtrl = ("MSMAPI.MAPIMessages");

    // SessionCtrl.SignOn();// , MessageCtrl.SessionID = SessionCtrl.SessionID;

    // MessageCtrl.Compose();

  • 286 8

    // e-mail MessageCtrl.RecipAddress = "mav@erpg.ru";// MessageCtrl.MsgSubject = " ";// MessageCtrl.MsgNoteText = " ";

    // MessageCtrl.Attachmentlndex = 0;MessageCtrl.AttachmentPathName = ("C:\filel.txt");MessageCtrl.Attachmentlndex = 1;

    MessageCtrl.AttachmentPathName = ("C:\file2.txt");

    // MessageCtrl.Send(0);

    // SessionCtrl.SignOff();

    send "" (-1), .

    V7Plus.dll V7Plus.dll : WMail,VVSysInfo,VVHttpReader XMLParser.

    ^

    -

    V7Mail, , - MAPI (, Microsoft Outlook Express Microsoft Outlook).

    ("v7Pius.dll"), - co3flaTb06beKT("Addin.v7Maii"), WMail. :

    1. .

  • - 287

    2. .

    3. .

    4. - .

    5. - .

    6. .

    8.5.

    :-

    8.5. V7Plus.dll

    , ;

    // V7Plus.dll("VVPlus.dll"); = ("Addln.VVMail");

    =("") ;// //

    .();// .(); .() = 1

    // , =.();// =.;

    // ( ).(0);// =.;

    // .(, ) = 1 .(-);.(1);

  • 288 8

    .();;

    ;

    // .();

    .

    1. .

    2. .

    3. .

    4. .

    5. - .

    6. .7. . 8.6 - V7Plus.dll.

    // V7Plus.dll("V7Plus.dll"); = (".711") ;

    // MAPI// ..("MAPI","", "");// .();// .("mavgerpg.ru") ;// .(":\file.txt");//

  • - 289

    .="!";

    // .=" ! .";

    // .();// .();

    ^~"

    v7Mail .

    v?Maii V7Plus.dll MAPI, - MAPI, .

    Rom-Mail.dll

    MAPI. - SMTP "1: 7.7" - Rom-Mail.dll, - .

    :

    MIME, UU-ENCODE; Base64 QuotedPrintable; : DOS, Windows-1251, KOI8-R,

    MAC; , (multipart); , , (attachment); TEKCT(plain/text), HTML(plain/html),

    RTF(richable); ( ),

    ;

    () ( ); ;

    (keep alive); ;

  • 290 8

    (From) (FromName), ;

    SMTP-; ;

    ;

    / ;0 20 ; (Ping). ROM-Mail.dll AddlnMail. 8.7 .

    {]"~~:~'~;"~~""'-~'^~~~~~~~~~~~~~~~~-~- - ".- ------,-, .--.------..-_-,1 8.7. ROM-Mail.dll

    // {"ROM-Mail.dll") = 1 // AddlnMail = ("Addln.AddlnMail");

    (" ROM-Mail.dll");;

    ;

    - -

    "" (- 8.8). .

    I 8.8. -

    // ("ROM-Mail.dll") = 1

    // AddlnMail = ("Addln.AddlnMail");

    (" ROM-Mail.dll");;

    ;// NetBIOS- IP- ()

  • - 291

    . = "pop.server.ru";// . = 110;// -. = "user";

    // -. = "password";

    // 1 - -, 0 - . = 1;

    // / . = 0;

    // .;"")=0 (" !");;

    ;

    // = 1 .()

    // .();// .();. = .;

    . = .;

    . = .;

    . = .;

    TS.MessagelD = .IDMessage; // . = .;

    . = .;

    // - (, ";"). = .;

    . = .;

    . = .; // ;

    // .();

    -

    .

  • 292 8

    ^~

    .

    .

    ,

    ,

    , :

    1. ALT ISO.2. ALT KOI.3. ALT MAC.4. ALT WIN.5. ISO ALT.6. ISO KOI.7. ISO MAC.8. ISO WIN.9. KOI ALT.

    10. KOI ISO.11. 1.

    12. KOI WIN.13. MAC ALT.14. MAC ISO.15. MAC KOI.16. MAC WIN.17. WIN ALT.18. WIN ISO.19. WIN KOI.20. WIN MAC. ,

    .

    , ,

    , .

    (- 8.9).

  • - _^ 293

  • 294 8

    11 SMTP-. = "password";// SMTP- . = 1;

    // .("") = 0 (" !");;

    ;

    . = "mav@erpg.ru";

    . = " ";

    . = "! ; 2";

    . = "3 ";

    . = "4 ";

    . = " ";

    . = " ";

    . = "C:\Temp\example.ert; C:\Temp\Readme.doc";.KowipoBKa="windows-1251";. = 0; // text/plain. =1; // . = 0;. = 1;

    // SMTP- .() = 1 (" !");

    (" !");;

    // .();

    .

    appiication/rtf text/html i 2 -, .

    ROM-Mail.dll Ping, - .

    pingText ping ( 8.11).

  • - 295

    // NetBIOS- IP- Host = "erpg.ru";

    // ("ROM-Mail.dll") = 1

    // AddlnMail = ("Addln.AddlnMail");

    (" ROM-Mail.dll");;

    ;

    // 72 ICMP.Ping(Host) ;// Ping(BK.PingText);

    :

    "IP-: 194.135.22.201; : 72; : 72; TTL: 128; 0%". ROM-Mail.dll , - | "1:".

    .

    :

    "1C:" ( 8.0) , v?Maii - "1:" ( 7.7) , MAPI. , -

    .

    , , -

    , .

    , : ,

    , , . .

    (- ).

  • 296 8

    G 6 .

    ( ).

    6 .

    . . -

    , ,

    , ,

    . ,

    .

    8.12 .

    // = ;

    // .("7",);//...// .();

    .

    . -

    . -

    (. . ). 8.13 , - ,

    .

    8. 13.

    / / = ;

    // . ( , ) ; = . (, );//

  • - 297

    11 = .();

    . = ..;

    . = .;

    ; ,

    = "";

    // .

    = + . + " ";

    ;

    . = ;

    . = .;

    . = .;

    // .

    // C:\Mail\..(":\Mail\" + .);;

    ;

    // .();

    /

    :

    1. .......

    , -

    .

    ...... -

    .

    2. "C:\Mail\".

    "1C: 8.0" . . -

    8.14 .

  • 298 8

    I/ = ;

    . = ;

    . = ;

    // ..("mav@erpg.ru");// . = "boss@erpg.ru";// ..(":\plan.txt");// = (":\trade.zip") ,..(,"trade.zip");// = ;

    // .();

    ^

    .

    "1C:"( 8.0) .

    .

    . ,

    MAPI -, - SMTP . .

    ,

    , -

    .

    -

    ( , SMTP-, , . .).

  • - 299

    (, , , , -

    . .).

    ( ). -

    .

    -

    (HTML, ).

    .

    ( ). -

    .

    ,

    .

    8.15 - .

    _ __,-__.

    15.

    = ;

    // SMTP-.SMTP = "smtp.erpg.ru";

    // -. = "pop.erpg.ru";

    // SMTP. = 25;

    // . = 110;// . = "boss";// SMTP-.SMTP = "boss";// . = "neskaju";// SMTP-

  • 300 _ 8

    . SMTP = "toje_neskaju";// . = 30;

    = ;

    //

    . ( ( ) ) ;

    ( ( ) ) ;;

    ;

    // . ( ) ;

    ^

    ... . ... -

    .

    -

    , -

    .

    8.16 , .

    8.16.

    = ;

    //

    . ();

    (());;

    ;

    .();

  • - 303

    (());;

    ;

    // .();

    ^

    ......,

    .

    .

    FTP FTP File Transfer Protocol ( ). FTP , , , ,

    . ,

    FTP, .

    FTP, -, FTP-. FTP- (Microsoft Internet Explorer, Netscape Navigator), - FAR, CuteFTP . FTP - ftp.exe, FTP, "1C:" ( 8.0).

    ftp.exe ftp . -

    .

    ftp ftp.exe, , - . , ftp, ,

    .

    ftp "1:" ( 7.7) ,

  • 304 8

    ftp . ftp. - (-) , ftp.

    ^~

    ftp-.

    ftp. -v ftp . -

    ftp, , --. ,

    , -

    , .

    , ftp . ftp , .

    , -v.

    ftp verbose.

    -d ftp . - ftp, ftp , -.

    . ftp debug.

    -i . - ftp-,

    . -

    , ftp . -n-

    ,

    user, .

    - , -

    UNIX, , , - *. , ftp - .

    glob.

    -: ftp . , , -

    .

    FTP "1:". 8.18 FTP- - .

  • - 305

    /I = "open ftp.server.ru// I user

    // I password// ftp...//...// Iquit

    I";.

    // = + "ftp\transfer.ftp";// ftp = ("");.() ;.();// ftp ("ftp -s:" + );// .();

    ,

    open, . - . -

    quit.

    . 8.1 ftp.

    8.1. ftp

    append .: append

    ascii ASCII ( ASCII)

    ] 1 . 722

  • 306 8

    8.1 ()

    bell

    binary

    bye quit

    cd

    close

    debug

    delete

    dir

    get recv

    glob

    hash

    .

    ,

    . :

    cd /usr/bin

    ftp

    . :

    delete

    . -

    :

    dir /usr/bin. ,

    . -

    , . -

    : dir /usr/bin printfile. ,

    :

    dir . printfile "."

    . :

    get . ,

    ,

    -

    .

    , UNIX, '*' "#" - , .

    -

    .

    , ftp . -

    "#"

  • - 307

    8.1 ()

    led

    Is

    mdelete

    mdir

    mget

    mkdir

    mis

    input

    , ftp. :led /usr/mav. , ""

    -

    , . :

    Is /usr/bin. , .

    . ftp, ,

    . :

    Is /usr/bin printfile. (printfile). ,

    printfi le: Is . printfi le "." ,

    . :

    mdelete < 2- > . . .

    ,

    . -

    , -

    . :

    mdir ... printfile

    .

    .

    , :

    mget ...

    . :

    mkdir /u/mydir

    .

    ,

    , :

    mis ... printfile

    .

    . -

    . :

    mput ...

  • 308 8

    8.1 ()

    open FTP . , -

    . :

    open ftp.server.ru

    prompt . ftp (- ) (, mget).

    put . send . :

    put put

    pwd quote ftp,

    .

    remotehelpremotehelp . -

    ftp , . -

    ,

    rename . :rename

    mdir .:

    rmdir /usr/mydir

    status bell, form, hash, glob, port, type

    type . ASCII. ascii binary. , ASCII

    trace . -

    user . -

    . : user mike cat myaccount

    verbose . - . -

    , ,

    . , -

  • - 309

    8.19 ftp .

    // = "open ftp.server.ru// luser// (password// [get file.rtf c:\file.rtfIget file.mp3 c:\mp3\file.mp3// Iput c:\file.htm file.htmIput c:\docs\file.txt file.txt// [delete file.rtf// FTP-Imkdir newdir//

    Iquit

    // = + "ftp\transfer.ftp";// ftp

    = ("");.();.();// ftp ("ftp -s:" + );// .();

  • 310 8

    "1C:" ( 8.0) - FTP . - ,

    , : , ,

    , . .

    FTP- , :

    , ;

    , ( - 21);

    ;

    CJ ;G (, -

    ); , ftp-

    ( ).

    , -

    .

    . 8.20 .

    I 8.20. ftp

    // FTP = ("ftp.server.ru",21,"user","password",,// FTP.("httpd/www/");// , = .'",);//

    // = .();. = .;

    . = .;

    // ,

  • - 311

    .() . = . ();. = .();

    ;

    ;

    .

    , 8.21, - .

    """"" ' " : ' ' ' " '.~'""~""""^ ""'

    // FTP = ("ftp.server.ru",21,"user","password",,);// .("usr/mav/");

    // FTP.("data.txt");// FTP.("tmp/", "*.txt");

    (());;

    , , -

    8.21, , , .

    -

    .

    ( 8.22).

    // FTP = ("ftp.server.ru",21,"user","password",,);// .("usr/mav/");// = (.);

  • 312 8

    . = ":\";. = " ...";

    . = ;

    .()

    // // FTP.(, . + "\" + );

    (());;

    ;

    ,

    , , -

    .

    , . . -

    , .

    8.23.

    // FTP = ("ftp.server.ru",21,"user","password",,);// FTP.("usr/mav/");// ftp = (.);. = ":\";. = " ftp...";. = ;

    .()

    // = (., (.)+1);// ftpFTP.(., );

    (());;

    ;

  • 9

    Active DirectoryService Interfaces

    ADSI Active Directory Service Interfaces (ADSI) , , -

    , WSH - (Active Directory Windows 2000/WindowsServer 2003, Windows Directory Service Windows NT 4.0, NDS NovellNetWare 4.x/5.x). ADSI Windows XP/2000/2003, ,

    Microsoft.

    ( , - . .), . -

    .

    (Directory Service) - ( ), . , -

    ,

    , .

    () , ,

    NetWare Bindery Novell Netware 3.x, NDS Novell NetWare 4.x/5.x,Windows Directory Service Windows NT 4.0 Active Directory Windows 2000. , - ,

    .

  • 314 9

    Microsoft Active Directory Service Interfaces (ADSI), - ActiveX, , - , . -

    , ADSI Windows /2000. - ,

    Microsoft. Active Directory : DNS (Domain Name Service); WinNT Provider Service', NWCOMPATProvider Service; LDAP (Lightweight Directory Access Protocol). TCP/IP DNS , , , LDAP Active Directory . WinNT Provider Windows NT, - NWCOMPAT Novell NetWare 3.x. WinNT Provider, .

    ADSI WinNT Provider , : ;

    ;

    , ;

    ;

    , -

    ;

    .

    ADSI.

    WinNT Provider WinNT Provider , - . 9.1.

  • Active Directory Service Interfaces 315

    9.1. WinNT Provider

    Namespace

    Domain

    User

    Group

    UserGroupCollection

    GroupCollection

    Computer

    PrintJob

    PrintJobsCollection

    PrintQueueService

    FileService

    FileShare

    Resource

    Session

    User

    Group

    .

    :

    Obj = ("WinNT://") Windows NT.:

    Obj = ("WinNT://MyDomain") .

    :

    = ("WinNT: //MyDomain/User" ) , .

    :

    ]= ("WinNT: //MyDomain/Group")

    Windows NT- .:

    = ("WinNT: //MyServer") .

    :

    ]=("WinNT://MyServer/aPrinter")

    -

    .

    :

    Obj = ("WinNT://MyServer/User") .

    :

    Obj = ("WinNT://MyServer/Group")

  • 316 9

    9.1 ()

    UserCollectionGroupCollectionSchemaClass

    PropertySyntax

    WinNT-

    NETBIOS, . . WinNTProvider DNS-. -

    . -

    ( 9.1).

    // ""Queue = ("WinNT:// Domain/Comp/aPrinter,printQueue");// "MAV"User = ("WinNT:// Domain/MAV,user");// ""Computer = ("WinNT://");

    WinNT Provider - , 9.2.

    // ("WinNT:", .),

    // (, )// NamespaceNameSpace = ();

  • Active Directory Service Interfaces 317

    //

    Domain NameSpace = . ();. = Domain.Name;// 4- .() < 4 ( + ?(HMH="WinNT:","//","/") +Domain.Name, .);

    ;

    ;

    ;

    //

    -

    .......

    , ,

    .

    ,

    .

    9.2 , . 9.1.

    -

    .

    1. , - "winNT:", .

    2. ......... .

    9.3.

    // = ("WinNT:");

  • 318 9

    (.Name);;

    -

    .

    1. , "WinNT:///,Group", .

    Group , .2. .........

    .

    ""

    9.4.

    // Obj = ("WinNT://" + +"/,group");(" " + );// Obj.Members() (.Name);

    ;

    -

    .

    1. , "1:// ".

    2. create ADSI, user - . create : .

    3. Description, .

  • Active Directory Service Interfaces 319

    4. setPassword .5. setinf ADSI . 9.5.

    // Computer = ("WinNT://" + );// UserUser = Computer.Create("user", );// User.Description = ;// User.SetPassword();// User.Setlnfo();

    -

    Delete, ( 9.6).

    9.6.

    // Computer = ("WinNT://" + );// Imp = Computer.Delete("user", );

    -

    , . ,

    Create "Group" (- 9.7).

    // Computer = ("WinNT://" + );// Group

  • 320 9

    User = Computer.Create("group", );// . User.Description = ;// User.SetlnfoO ;

    -

    Delete.

    WinNT Provider :, , .

    , -

    9.5 9.6. 9.8 , -

    .

    // User = ("WinNT://" + + "/" + + ",user");// , // User.Put("PasswordExpired", 1);// User.SetlnfoO ;(" " + + " " + +" . ") ;

    PasswordExpired 1, , - . Setinfo - .

    Accountoisabied ,

    .

    9.9 .

  • Active Directory Service Interfaces 321 ._.._-... _ , _ . _ . ....... ^

    9.9.

    // User = ;"WinNT://" + + "/" +);// User.AccountDisabled = ;// User.SetlnfoO ;// (" " + + ": " +User.AccountDisabled);

    AccountExpirationDate - . 9.10 , 5 2007 .

    // User = ("WinNT://" + + "/" +) ;// User. AccountExpirationDate = "05/06/2007";// User.SetlnfoO ;

    ^

    , -

    AccountExpirationDate.

    . 9.1, WinNT Provider - , . -

    , . 9.2.

    ^^

    .

  • 322 9

    9.2. WinNT Provider

    Computer

    Domain

    FileService

    FileShare

    FPNWFileService

    DivisionOwnerOperatingSysternOperatingSystemVersionProcessorProcessorCount

    MinPasswordLengthMinPasswordAgeMaxPasswordAgeMaxBadPasswordsAllowedPasswordHistoryLengthAutoUnlocklntervalLockoutObservatiohlnterval

    HostComputerDisplayNameVersionServiceTypeStartTypePathErrorControlLoadOrderGroupDescriptionMaxUserCountServiceAccountNameDependencies

    CurrentUserCountDescriptionHostComputerPathMaxUserCount

    HostComputerDisplayNameVersionServiceTypeStartTypePathErrorControlLoadOrderGroup

  • Active Directory Service Interfaces 323

    9.2 ()

    FPNWFileServi.ee

    FPNWFileShare

    FPNWResource

    FPNWSession

    Group

    Namespace

    PrintJob

    PrintQueue

    ServiceAccountNameDependenciesDescriptionMaxUserCount

    CurrentUserCountHostComputerPathMaxUserCount

    UserPathLockCount

    UserComputerConnectTime

    DescriptionobjectSid

    HostPrintQueueUserTimeSubmittedTotalPagesSizeDescriptionPriorityStartTimeUntilTimeNotifyTimeElapsedPagesPrintedPositionActionObjectGUIDPrinterPathPrinterNameModelDatatypePrintProcessorPrintDevices

  • 324 9

    9.2 ()

    PrintQueue

    Resource

    Service

    Session

    User

    DescriptionHostComputerLocationStartTimeUntilTimeDefaultJobPriorityJobCountPriorityAttributesBannerPageObjectGuidAction

    UserPathLockCount

    HostComputerLoadOrderGroupServiceAccountNameDependenciesStartTypeServiceTypeDisplayNamePathErrorControl

    ComputerConnectTimeIdleTimeUser

    AccountExpirationDateAutoUnlocklntervalBadPasswordAttemptsDescriptionFullNameHomeDirDriveHomeDirectorUserFlagsLockoutObservationlntervalLoginHours

  • Active Directory Service Interfaces 325

    9.2 ()

    User LastLoginLastLogoffLoginScriptLoginWorkstationsMinPasswordAgeMinPasswordLengthMaxBadPasswordsAllowedMaxLoginsMaxPasswordAgeMaxStorageObjectSidParametersPasswordAgePasswordExpirationDatePasswordExpiredPasswordHistoryLengthPrimaryGroupIDProfile

    , . 9.2 -. -

    ADSI. 9.11 (- , . .).

    // Computer = ("WinNT://" + );// ("Division = " + Computer.Division);("Owner = " + Computer.Owner);("OperatingSystem = " + Computer.OperatingSystem);("OperatingSystemVersion = " + Computer.OperatingSystemVersion};("Processor = " + Computer.Processor);("ProcessorCount = " + Computer.ProcessorCount);

  • 326 9

    user, ( -, , , . .). 9.12.

    .12.

    // User = ("WinNT://" + + "/" +);// ("FullName = " + User.FullName);("AccountExpirationDate = " + User.AccountExpirationDate);("AutoUnlocklnterval = " + User.AutoUnlocklnterval);("BadPasswordAttempts = " + User.BadPasswordAttempts);("Description = " + User.Description);("HomeDirDrive = " + User.HomeDirDrive);("HomeDirectory = " + User.HomeDirectory);("UserFlags = " + User.UserFlags);("LockoutObservationlnterval = " +User.LockoutObservationlnterval);("LoginHours = " + User.LoginHours);("LastLogin = " + User.LastLogin);("LoginScript = " + User.LoginScript);("MinPasswordAge = " + User.MinPasswordAge);("MinPasswordLength = " + User.MinPasswordLength);("MaxBadPasswordsAllowed = " + User.MaxBadPasswordsAllowed);("MaxPasswordAge = " + User.MaxPasswordAge);("MaxStorage = " + User.MaxStorage);("ObjectSid = " + User.ObjectSid);("Parameters = " + User.Parameters);("PasswordAge = " + User.PasswordAge);("PasswordExpirationDate = " + User.PasswordExpirationDate);("PasswordExpired = " + User.PasswordExpired);("PasswordHistoryLength = " + User.PasswordHistoryLength);("PrimaryGroupID = " + User.PrimaryGroupID);("Profile = " + User.Profile);

    ,

    , -

    9.1.

  • Active Directory Service Interfaces 327

    SID (user security identifier), - Get, objectsio. COMSafeArray, .

    , .........

    .

    9.13.

    // User = '://" + + "/" +);// SID (user security identifier)Sid = User.Get("objectSID"); // COMSafeArray = ();// COMSafeArray = Sid.();SidCTpOKa = "";//

    SidCTpOKa = SidCTpoKa + + " ";;("SID " + + ":" + SidCTpoKa)

  • -

    CD-ROM , . -

    Offline- - ERP Group (www.erpg.ru), - .

    - . .1.

    . 1. -

    Chapter 01 \ActiveBarCode.epf

    ActiveBarCode.ert

    HTML Editor.epf

    InternetExplorer.epf

    InternetExplorer.ert

    IP.epf

    MSAgent.epf

    MSAgentert

    MSAgentBalloonDialog.epf

    , 1.

    ActiveBarcode "1C: 8.0"

    ActiveBarcode "1C: 7.7"

    HTML- "1: 8.0" internetExplorer "1: 8.0" InternetExplorer "1: 7.7"

    IP- "1: 8.0" MS Agent "1: 8.0 MS Agent "1: 7.7" MS Agent "1C: 8.0"

  • 330

    . 1 ()

    Chapter 01 \MSAgentBalloonDialog.ert

    RegExp.epf

    WindowsMediaPlayer.epf

    , 1.

    MSAgent "1: 7.7"

    "1: 8.0" WindowsMedia Player "1: 8.0"

    Chapter 02\ComputerSystemlnformation.epf

    WMI.epf

    WMI.ert

    WMICIassViewer.epf

    WmiServices. classes

    WmiServices.ert

    , 2.

    "1C: 8.0" WMI "1: 8.0" WMI "1C: 7.7" WM), "1: 8.0" WMI-, - WmiServices.ert WMI, "1: 7.7"

    Chapter 03\FileSystemObject.epf

    MSScriptControl.epf

    ReadMPSTags.epf

    WSH.epf

    , 3.

    "1: 8.0" VB- (VBS) "1: 8.0" (iDvl) - "1: 8.0 WSH "1: 8.0"

    Chapter 04\Photoshop.epf

    V8 Application, vbs

    , 4.

    Adobe Photoshop - OLE- "1: 8.0" OLE- "1: 8.0" VBS

  • - 331

    . 1 ()\

    Chapter 04\VSApplicationCOMConnector.epfVSCOMConnector.vbs

    WordCheckSpelling.epf

    WordExcel.epf

    WordMacros.epf

    , 4.

    -

    "1:8.0"

    -

    "1: 8.0" VBS

    MS Word "1: 8.0" MS Word Excel OLE- "1: 8.0" MSWord "1: 8.0"

    Chapter 05\ADO Demo.epf

    ADO Demo.ert

    ExcelADO.epf

    HexDumper.epf

    ProjectADO.epf

    example.mpp

    , 5.

    -

    ADO "1: 8.0" -

    ADO "1: 7.7" MS Excel ADO "1C: 8.0"

    ADO "1C: 8.0" MS Project - ADO "1C: 8.0" ,

    ProjectADO.epfChapter 06\

    SQL-DMO Demo.ert , 6.

    MS SQL Server SQL-DMO "1C: 7.7"

    Chapter 07\ControlPanel.epf

    , 7,

    Windows, - rundl!32 "1: 8.0"

    Chapter 08\FTP.epf

    FTP.ert

    , 8.

    FTP "1: 8.0"

    FTP ftp "1: 7.7"

  • 332

    . 1 ()

    Chapter 08\Mail.epf

    Mail.ert

    RomPopS.ert

    RomSmtp.ert

    , 8.

    "1: 8.0"

    "1: 7.7"

    "1: 7.7"

    SMTP "1C: 7.7"

    Chapter 09\ADSI.epf

    , 9. Active Directory ServiceInterfaces "1: 8.0"

    AddOm

    ActiveBarcodeADSI

    COMServices

    COMViewerIE60MDACMSAgent

    ROM-MailWmi

    WmpWsh

    XMLCoreERPG.ruN

    -, -

    .

    ActiveBarcode 3.50Microsoft Active Directory Service Interfaces version 2.5(ADSI)- ( VB), - -

    "1: 7.7"

    OLE/COM Object ViewerInternet Explorer 6.0 Microsoft Data Access Components 2.8 Microsoft Agent 2.0, SDK ROM-MailWindows Management Instrumentation (WMI) Core 1.5(Windows 95/98)Distributed Component Object Model (DCOM) for Win-dows 95/98 1.3 Windows Media Player 9.0Windows Script 5.6 SDKMS XML Core 4.0Offline- Web- "ERP Group" - (www.erpg.ru)

  • ActiveX- Media Player 24

    -

    "1C: 8.0" 143- 143

    HTML- 45

    MAPI 282Microsoft Agen 26

    OLE 1 130OLE 2 130OLE DB 185OLE- 129

    sSQL-DMO 227

    wWin32_ComputerSystem 78Windows Script Host 97WinNT Provider 314WMI- 63

    : 288 286

    :

    317 113

    318

    OLE- 141 134

    115

    88:

    MicrosoftProject 214

    143

    :

    MS Excel 165 177

  • 334

    :CIM_DataFile 85StdRegProv 91Win32_Account 78Win32_DesktopMonitor 77Win32_Group 78 80Win32_LocalTime 82Win32_LogicalDisk 63 67Win32_NetworkAdapter 94Win32_NetworkAdapter

    Configuration 93Win32_NTEventLogFile 83Win32_Printer 87Win32_Process 72Win32_Product 69Win32_ScheduledJob 89Win32_Service 71Win32_Share 87Win32_StartupCommand 77\Vin32_TimeZone 82Win32_WindowsProduct

    Activation 77Win32_OperatingSystem 75WMI 61

    :mailto 281ping 94

    V7Plus.dll 286

    13

    185 OLE 129

    Word 151 104

    :Activate 147Add 147

    AnimationNames 30Buttons.Add 44CheckSpelling 161Close 147Connect 137, 230InputBalloon 41MoveTo 3MsgBalloon 38, 39NewObject 138, 139, 141Open 147OptionButtonsAdd 44Play 30PrintOut 148ShowFormBalloon 44Speak 31StartService 74Stop 31StopA1131StopService 74Terminate 74Think 31Uninstall 71 46

    :

    Win32_Product 70 Command 194 RegExp 54 WshNetwork 119 46

    52 13 117

    22

    Excel 166:

    Application 164Balloon 35Command 186, 192

  • 335

    Connection 186Drive 100Error 186Field 187File 100FileSystemObject 100Folder 100FormBalloon 41MAPIMessage 283MAPISession 283Record 187RecordSet 186, 198RegExp 54Stream 187SWbemLocator 64Winsock 20Word. Application 147

    :

    ADOX 202WMI 59

    WSH 97 126:

    82IP- 21, 94 82 78 80 80 77

    77:

    93 320

    SMTP- 293

    105 PowerPoint 178 86

    179 :

    102 100

    :

    81 73 108

    70

    104 ftp 303:

    90 85

    84 78

    :

    Microsoft Word 146 82 83 89 75 119 85 93

    52

    :

    MS Agent 33 Win32_

    ComputerSystem 78 Win32_Product 69 ActiveBarcode 22 Command 193 DBFile 235

    ( . . 336)

  • 336

    (): LogFile 235 Winsock 20 WshNetwork 119 WinNT Provider 32 1ButtonsCaptions 39Document 16Font 45OptionPressed 44Style 151Tables 159UserName 80 OLE 129 153

    319:

    90 84 93 318 9

    AdobePhotoshop 181

    105 106 114 URL- 1 16

    MS Word 149

    MS Word 147 177

    230

    :ActiveX 14ADSI 313WMI60 13

    17

    : 71 105

    :

    180 87 320

    :

    89 73

    122

    :

    92 , 290

  • 1C:

    7.7/8.0

    "1:" 7.7 8.0, " *. "1:! 1:-

    "- "1 (^ "

    "1: 8.0", "1C-Papyc:CRM ", ". : " . "1C",

    8.0. - - " ",

    "1: 8.0".

    "1:". , , , ,

    -.

    , -

    , "1:" ActiveX, COM, WMI WSH, ADO SQL-DMO, , FTP, .

    - , "1:* .

    ,

    ""

    .

    . -

    , .

    1/1:

    ISBN 5-94157-536-

    -

    ,

    ,

    -.

    "575367"- 190005, ., 29E-mail: mail@bhv.ru Internet: wwwbhv.ru.:(812)251-4244 :(812)251-1295

Recommended

View more >