DocSetProtectionFlags¶
DocSetProtectionFlags setzt ein Password, einen Passwordkommentar und Protection-Flags.
-
bool = DocSetProtectionFlags(hDoc, flags, ssPassword, ssComment)
Returnwert
bool ist TRUE (1), wenn die Funktion erfolgreich war und sonst FALSE (0).
Parameter
-
hDoc
hDoc ist die Zugriffsnummer eines UniPlot-Dokuments.
-
flags
Die Flags
PROTECT_READ
undPROTECT_WRITE
können oder-verknüpft werden.PROTECT_READ|PROTECT_WRITE
schützt das Dokument gegen Öffnen und Veränderung.
Wert | Bedeutung |
---|---|
PROTECT_NONE (0) | Kein Schutz. |
PROTECT_READ (1) | Schutz gegen Öffnen. |
PROTECT_WRITE (2) | Schutz gegen Verändern. |
-
ssPassword
ssPassword ist das Password. Gross-/Kleinschreibung wird unterschieden.
-
ssComment
ssComment ist der Kommentar. Der Kommentar wird beim Öffnen des Dokumentes angezeigt.
Beispiel
hDocTemplate = DocCreate(GetRootDirectory() + "/template/template-de.ipz", 3);
hDocNew = DocCreate();
DocCopyPage(hDocTemplate, 4, hDocNew);
DocSetProtectionFlags(hDocNew, PROTECT_READ, "hallo", "hallo");
DocSave(hDocNew, "d:/test.ipw");
DocDestroy(hDocTemplate);
DocDestroy(hDocNew);
hDoc = DocCreate("d:/test.ipw", 0, "hallo");
Kommentar
Das Dokument wird durch diesen Befehl nicht verschlüsselt. Der Befehl bietet also keinen echten Schutz gegen Lesen der in der Datei enthaltenen Informationen.
id-520023