Защита информации в системах дистанционного обучения с монопольным доступом

Реферат - Компьютеры, программирование

Другие рефераты по предмету Компьютеры, программирование

8; . , , , .

 

 

4.4.

4.4.1. Visual C++

, , COM Uniprot , Visual C++.

  1. .
  2. . : export.h, export.cpp, Uniprot.tlb.
  3. MFC ClassWizard.
    View->ClassWizard.
  4. Add Class "From a type library…".
  5. Uniprot.tlb .
  6. Confirm Classes "Ok". , .
  7. MFC ClassWizard.
  8. export.h, export.cpp.
  9. include "export.h" , Uniprot.
  10. , COM. CoInitialize.
  11. COM .

IProtect ProtectObj;

IProtectFile ProtectFileObj;

ProtectObj.CreateDispatch(UniprotLibID);

ProtectFileObj.CreateDispatch(UniprotLibID);

LPDISPATCH pDisp = ProtectFileObj.m_lpDispatch;

HRESULT hr = pDisp ->QueryInterface(

IProtectFileIntarfaceID,

(void**)&ProtectFileObj.m_lpDispatch);

VERIFY(hr == S_OK);

 

4.4.2. Visual Basic

, , COM Uniprot , Visual Basic.

  1. .
  2. . : Uniprot.tlb.
  3. References.
    Project->References.
  4. Browse.
  5. Uniprot.tlb .
  6. Uniprot 1.0 Type Library Ok.
  7. COM .

Dim handle As Integer

Dim obj As New protect

 

Dim ver As Integer

Dim strInfo As String

obj.GetInfo ver, strInfo

Dim s As String

s = "Version:" + Str(ver / 256) + "." +

Str((ver Mod 256) / 16) + Str(ver Mod 16)

s = s + Chr(13) + "Info:" + strInfo

MsgBox s

 

Dim file As IProtectFile

Set file = obj

handle = file.Create(FileName, Default, cryptUPT)

 

&n