DotNetWikiBot Framework Documentation

The Bot type exposes the following members.

Constructors

  NameDescription
Public methodBot
Initializes a new instance of the Bot class

Methods

  NameDescription
Public methodStatic memberCapitalize
This auxiliary function makes the first letter in specified string upper-case. This is often required, but strangely there is no such function in .NET Framework's String class.
Public methodStatic memberCountMatches
This auxiliary function counts the occurrences of specified string in specified text. This count is often required, but strangely there is no such function in .NET Framework's String class.
Public methodStatic memberDisableSilenceMode
Call this function to disable silent mode previously enabled by EnableSilenceMode()()()() function.
Public methodStatic memberEnableLogging
Call this function to make bot write all output to the specified file instead of a console. If only error logging is desirable, first call this function and after that call EnableSilenceMode()()()() function.
Public methodStatic memberEnableSilenceMode
Call this function to make bot report only errors and warnings, no other messages will be displayed or logged.
Public methodStatic memberGetMatchesPositions
This auxiliary function returns the zero-based indexes of all occurrences of specified string in specified text.
Public methodStatic memberGetMostRecentSiteObject
Gets most recent Site object constructed by framework.
Public methodStatic memberGetSubstring(String, String, String)
This auxiliary function returns part of the string which begins with some specified substring and ends with some specified substring.
Public methodStatic memberGetSubstring(String, String, String, Boolean, Boolean, Boolean)
This auxiliary function returns part of the string which begins with some specified substring and ends with some specified substring.
Public methodStatic memberGetWebResource
This wrapper function gets web resource in a fault-tolerant manner. It should be used only in simple cases, because it sends no cookies, it doesn't support traffic compression and it lacks other useful features.
Public methodStatic memberGetXMLIterator
This helper function constructs XPathDocument object, makes XPath query and returns XPathNodeIterator object for selected nodes.
Public methodStatic memberGetXMLReader
This helper function constructs XmlReader object using provided XML source code.
Public methodStatic memberGetXMLSubstring
This helper function deletes everything before startTag and everything after endTag in the provided XML/XHTML source code and then inserts back the deleted DOCTYPE definition and root element of XML/XHTML document.
Public methodStatic memberLoadLocalizedMessages
Function loads localized bot's interface messages from "DotNetWikiBot.i18n.xml" file. Function is called in Bot class constructor, but it can also be called manually to change interface language at runtime.
Public methodStatic memberMsg
Gets localized (translated) version of specified bot's interface message.
Public methodStatic memberRemoveXMLRootAttributes
This helper function removes all attributes of root XML/XHTML element (XML namespace declarations, schema links, etc.) to ease processing.
Public methodStatic memberUncapitalize
This auxiliary function makes the first letter in specified string lower-case. This is often required, but strangely there is no such function in .NET Framework's String class.
Public methodStatic memberUrlEncode
This wrapper function encodes string for use in URI. The function is necessary because Mono framework doesn't support HttpUtility.UrlEncode() method and Uri.EscapeDataString() method doesn't support long strings, so a loop is required. By the way HttpUtility.UrlDecode() is supported by Mono, and a functions pair Uri.EscapeDataString()/HttpUtility.UrlDecode() is commonly recommended for encoding/decoding. Although there is another trouble with Uri.EscapeDataString(): prior to .NET 4.5 it doesn't support RFC 3986, only RFC 2396.
Public methodStatic memberUserConfirms
This function asks user to confirm next action. The message "Would you like to proceed (y/n/a)? " is displayed and user response is evaluated. Make sure to set askConfirm variable to "true" before calling this function.
Public methodStatic memberWait
Suspends execution for specified number of seconds.

Fields

  NameDescription
Public fieldStatic memberaskConfirm
If true the bot asks user to confirm next Save(), RenameTo() or Delete() operation. False by default.
Public fieldStatic memberbotVer
Title and description of this bot as a web agent.
Public fieldStatic membercacheDir
Local cache directory. Adjust it if required.
Public fieldStatic membercommonDataXml
Some unparsed supplementary data. You can see it here.
Public fieldStatic memberisRunningOnMono
If true, assembly is running on Mono framework. If false, it is running on Microsoft .NET Framework. This variable is set automatically, don't change it's value.
Public fieldStatic memberlastSite
Last Site object constructed by the framework.
Public fieldStatic membermessages
Dictionary containing localized DotNetWikiBot interface messages.
Public fieldStatic membernl
Shortcut for Environment.NewLine property. It's "\r\n" on Windows and "\n" on Unix-like systems.
Public fieldStatic memberversion
Version of DotNetWikiBot Framework.

See Also