Защита информации в системах дистанционного обучения с монопольным доступом
Реферат - Компьютеры, программирование
Другие рефераты по предмету Компьютеры, программирование
8; . , , , .
4.4.
4.4.1. Visual C++
, , COM Uniprot , Visual C++.
- .
- . : export.h, export.cpp, Uniprot.tlb.
- MFC ClassWizard.
View->ClassWizard. - Add Class "From a type library…".
- Uniprot.tlb .
- Confirm Classes "Ok". , .
- MFC ClassWizard.
- export.h, export.cpp.
- include "export.h" , Uniprot.
- , COM. CoInitialize.
- 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.
- .
- . : Uniprot.tlb.
- References.
Project->References. - Browse.
- Uniprot.tlb .
- Uniprot 1.0 Type Library Ok.
- 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