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

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

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

235; COM-. , . IProtect. / . , obj IProtectFile.

Dim obj As New protect

Private Sub Edit_Click()

Form1.ole_doc.DoVerb

End Sub

Private Sub Form_Load()

Form1.ole_doc.Format = "Rich Text Format"

End Sub

4 /. . , . "c:\temp\crypt.upt" "c:\temp\decrypt.upt" . "c:\temp\cryptres.upt" "c:\temp\decryptres.upt" . - "c:\temp\crypt.upt" , "c:\temp\decrypt.upt" "c:\temp\decryptres.upt". - "c:\temp\decrypt.upt", "c:\temp\cryptres.upt".

Private Sub Generate_Click()

Dim days As Integer

days = DaysLimit

obj.GenerateTimeLimitUPTfiles "c:\temp\crypt.upt", "c:\temp\decrypt.upt", days

obj.GenerateTimeLimitUPTfiles "c:\temp\cryptres.upt", "c:\temp\decryptres.upt", days

End Sub

. .

Private Sub Import_Click()

Open "c:\temp\temp.rtf" For Input As #1

Dim str, tmp

Do While Not EOF(1)

Input #1, tmp

str = str + tmp

Loop

Close #1

Form1.ole_doc.DoVerb vbOLEDiscardUndoState

Form1.ole_doc.DataText = str

Form1.ole_doc.Update

End Sub

. .

Dim file As IProtectFile IProtectFile, / .

handle = file.Open("c:\temp\temp.dat", "c:\temp\decrypt.upt", "c:\temp\crypt.upt") .

readSize = file.Read(handle, v) Variant, .

file.Close (handle) .

Private Sub Load_Click()

Dim handle As Integer

Dim file As IProtectFile

Set file = obj

handle = file.Open("c:\temp\temp.dat", "c:\temp\decrypt.upt", "c:\temp\crypt.upt")

Dim readSize As Long

Dim v As Variant

readSize = file.Read(handle, v)

Dim str As String

str = v

Form1.ole_doc.DoVerb vbOLEDiscardUndoState

Form1.ole_doc.DataText = str

Form1.ole_doc.Update

file.Close (handle)

End Sub

 

.

Private Sub Save_Click()

Dim handle As Integer

Dim file As IProtectFile

Set file = obj

handle = file.Create("c:\temp\temp.dat", Default, "c:\temp\crypt.upt")

Dim writeSize As Long

Dim v As Variant

Dim str As String

str = Form1.ole_doc.DataText

v = str

writeSize = file.Write(handle, v)

file.Close (handle)

End Sub

 

,