DotNetWikiBot Framework Documentation Protects or unprotects the page, so only authorized group of users can edit or
rename it. Changing page protection mode requires administrator (sysop)
rights.
Namespace: DotNetWikiBotAssembly: DotNetWikiBot (in DotNetWikiBot.dll) Version: 0.0.0.0
Syntax
C# |
---|
public void Protect(
int editMode,
int renameMode,
bool cascadeMode,
DateTime expiryDate,
string reason
) |
Parameters
- editMode
- Type: System..::..Int32
Protection mode for editing this page (0 = everyone allowed
to edit, 1 = only registered users are allowed, 2 = only administrators are allowed
to edit).
- renameMode
- Type: System..::..Int32
Protection mode for renaming this page (0 = everyone allowed to
rename, 1 = only registered users are allowed, 2 = only administrators
are allowed).
- cascadeMode
- Type: System..::..Boolean
In cascading mode all the pages, included into this page
(e.g., templates or images) are also automatically protected.
- expiryDate
- Type: System..::..DateTime
Date and time, expressed in UTC, when protection expires
and page becomes unprotected. Use DateTime.ToUniversalTime() method to convert local
time to UTC, if necessary. Pass DateTime.MinValue to make protection indefinite.
- reason
- Type: System..::..String
Reason for protecting this page.
Examples
| Copy |
---|
page.Protect(2, 2, false, DateTime.Now.AddDays(20), "persistent vandalism"); |
See Also