ZennoPoster

Assembly: ZennoLab.CommandCenter
Full name: ZennoLab.CommandCenter.ZennoPoster
Kind: class


Represents a set methods to recognize captcha, working with mail, instances, etc.

Constructor

ZennoPoster()

Constructor

Methods

HttpGet

Method

string HttpGet(string url, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, String[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl)

Executes get request

Parameters

TypeNameDescription
stringurlTarget address of request.
stringproxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
stringEncodingEncoding format.
ResponceTyperespTypeResponse type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File).
intTimeoutTimeout in milliseconds of request.
stringCookiesCookies for request.
stringUserAgentUserAgent for request.
boolUseRedirecttrue if use redirect; otherwise, false.
intMaxRedirectCountMaximum count of redirects.
String[]AdditionalHeadersAn array of captures an array of additional headers.
stringDownloadPathDownload path for file.
boolUseOriginalUrltrue if use original url; otherwise, false.

Returns: The result of request.

Example

var resultHttpGet = ZennoPoster.HttpGet("https://www.google.ru/", "", "UTF-8",respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);

Example2

$resultHttpGet = ZennoLab\CommandCenter\ZennoPoster::HttpGet("https://www.google.ru/", "", "UTF-8", ZennoLab\InterfacesLibrary\Enums\Http\ResponceType::HeaderAndBody);

HttpPost

Method

string HttpPost(string url, string content, string contentPostingType, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, String[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl)

Executes post request

Parameters

TypeNameDescription
stringurlTarget address of request.
stringcontentThe content of post request.
stringcontentPostingTypeThe type of content.
stringproxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
stringEncodingEncoding format.
ResponceTyperespTypeResponse type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File).
intTimeoutTimeout in milliseconds of request.
stringCookiesCookies for request.
stringUserAgentUserAgent for request.
boolUseRedirecttrue if use redirect; otherwise, false.
intMaxRedirectCountMaximum count of redirects.
String[]AdditionalHeadersAn array of captures an array of additional headers.
stringDownloadPathDownload path for file.
boolUseOriginalUrltrue if use original url; otherwise, false.

Returns: The result of request.

Example

var resultHttpPost = ZennoPoster.HttpPost("http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi", 
                "Comments=This+is%0D%0Asome+text%0D%0Ain+several+lines.&box=yes&hidden+field=something", 
                "application/x-www-form-urlencoded", "", "iso-8859-1",respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);

Example2

$resultHttpPost = ZennoLab\CommandCenter\ZennoPoster::HttpPost("http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi", 
                "Comments=This+is%0D%0Asome+text%0D%0Ain+several+lines.&box=yes&hidden+field=something", 
                "application/x-www-form-urlencoded", "", "iso-8859-1", ZennoLab\InterfacesLibrary\Enums\Http\ResponceType::HeaderAndBody);

HttpPost

Method

string HttpPost(string url, Byte[] content, string contentPostingType, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, String[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl)

Executes post request

Parameters

TypeNameDescription
stringurlTarget address of request.
Byte[]contentThe content of post request.
stringcontentPostingTypeThe type of content.
stringproxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
stringEncodingEncoding format.
ResponceTyperespTypeResponse type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File).
intTimeoutTimeout in milliseconds of request.
stringCookiesCookies for request.
stringUserAgentUserAgent for request.
boolUseRedirecttrue if use redirect; otherwise, false.
intMaxRedirectCountMaximum count of redirects.
String[]AdditionalHeadersAn array of captures an array of additional headers.
stringDownloadPathDownload path for file.
boolUseOriginalUrltrue if use original url; otherwise, false.

Returns: The result of request.

GetNewInstance

Method

void GetNewInstance(String& url, Int32& port, String& address, BrowserType browserType, string browserArgs)

Parameters

TypeNameDescription
String&url
Int32&port
String&address
BrowserTypebrowserType
stringbrowserArgs

ShowInstance

Method

void ShowInstance(string url, int port, string address)

Show the instance

Parameters

TypeNameDescription
stringurlPipe host of instance (127.0.0.1).
intportInstance port.
stringaddressInstance work mode.

Example

var url = "";
            var port = 0;
            var address = "";
            // Gets parameters of instance
            ZennoPoster.GetNewInstance(out url, out port, out address);
            // Show the instance
            ZennoPoster.ShowInstance(url, port, address);

Example2

$url = "";
            $port = 0;
            $address = "";
            // Gets parameters of instance
            ZennoPoster::GetNewInstance($url, $port, $address);
            // Show the instance
            ZennoPoster::ShowInstance($url, $port, $address);

HideInstance

Method

void HideInstance(string url, int port, string address)

Hide the instance

Parameters

TypeNameDescription
stringurlPipe host of instance (127.0.0.1).
intportInstance port.
stringaddressInstance work mode.

Example

var url = "";
            var port = 0;
            var address = "";
            // Gets parameters of instance
            ZennoPoster.GetNewInstance(out url, out port, out address);
            // Hide the instance
            ZennoPoster.HideInstance(url, port, address);

Example2

$url = "";
            $port = 0;
            $address = "";
            // Gets parameters of instance
            ZennoPoster::GetNewInstance($url, $port, $address);
            // Hide the instance
            ZennoPoster.HideInstance($url, $port, $address);

ReleaseInstance

Method

void ReleaseInstance(string url, int port, string address)

Release the instance

Parameters

TypeNameDescription
stringurlPipe host of instance (127.0.0.1).
intportInstance port.
stringaddressInstance work mode.

Example

// Release the instance on the known port
            ZennoPoster.ReleaseInstance("127.0.0.1", port, "server");

Example2

// Release the instance on the known port
            ZennoPoster::ReleaseInstance("127.0.0.1", $port, "server");

CaptchaSpecialRecognition

Method

string CaptchaSpecialRecognition(string dllName, Instance instance, bool asyncRecognize)

Recognizes the special captcha through the specified DLL library.

Parameters

TypeNameDescription
stringdllNameThe path to DLL library.
InstanceinstanceThe instance with captcha for recognition.
boolasyncRecognizetrue if need async way to recognize; otherwise and default, false.

Returns: The recognition result or id of async task.

Example

public static int Execute(Instance instance)
            {
                instance.ClearCookie();
             
                Tab tb = instance.MainTab;
                if ((tb.IsVoid) || (tb.IsNull)) return -1;
                if (tb.IsBusy) tb.WaitDownloading();
                tb.Navigate("http://lessons.zennolab.com/ru/advanced");
                if (tb.IsBusy) tb.WaitDownloading();
             
                ZennoPoster.CaptchaSpecialRecognition("KeyCaptcha.dll", instance);
                         
                return 0;
            }

Example2

public static function Execute($instance)
            {
                $instance->ClearCookie();
             
                $tb = $instance->MainTab;
                if (($tb->IsVoid) || ($tb->IsNull)) return -1;
                if ($tb->IsBusy) $tb->WaitDownloading();
                $tb->Navigate("http://lessons.zennolab.com/ru/advanced");
                if ($tb->IsBusy) $tb->WaitDownloading();
                
                ZennoPoster::CaptchaRecognition("KeyCaptcha.dll", $instance);
                 
                return 0;
            }

CaptchaRecognition

Method

string CaptchaRecognition(string dllName, string captcha, string parameters, bool asyncRecognize)

Recognizes the captcha through the specified DLL library.

Parameters

TypeNameDescription
stringdllNameThe path to DLL library.
stringcaptchaThe captcha for recognition.
stringparametersThe recognition parameters.
boolasyncRecognizetrue if need async way to recognize; otherwise and default, false.

Returns: The recognition result or id of async task.

Example

public static int Execute(Instance instance)
            {
                instance.ClearCookie();
             
                Tab tb = instance.MainTab;
                if ((tb.IsVoid) || (tb.IsNull)) return -1;
                if (tb.IsBusy) tb.WaitDownloading();
                tb.Navigate("http://lessons.zennolab.com/ru/advanced");
                if (tb.IsBusy) tb.WaitDownloading();
             
                HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("img", "fulltag", "img", "text", 0);
             
                string res = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "");
             
                he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
                he.SetValue(res, "Middle", false);
                        
                return 0;
            }

Example2

public static function Execute($instance)
            {
                $instance->ClearCookie();
             
                $tb = $instance->MainTab;
                if (($tb->IsVoid) || ($tb->IsNull)) return -1;
                if ($tb->IsBusy) $tb->WaitDownloading();
                $tb->Navigate("http://lessons.zennolab.com/ru/advanced");
                if ($tb->IsBusy) $tb->WaitDownloading();
             
                $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("img", "fulltag", "img", "text", 0);
             
                $res = ZennoPoster::CaptchaRecognition("MonkeyEnter.dll", $he->DrawToBitmap(true), "");
             
                $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("recaptcha_response_field");
                $he->SetValue($res, "Middle", false);
                        
                return 0;
            }

CaptchaRecognition

Method

string CaptchaRecognition(string dllName, string captcha, string parameters, bool asyncRecognize, String& confidence)

Parameters

TypeNameDescription
stringdllName
stringcaptcha
stringparameters
boolasyncRecognize
String&confidence

ContextRecognition

Method

string ContextRecognition(string text, string themesType, int maxThemes, int relevance)

Recognizes the themes for the specified text.

Parameters

TypeNameDescription
stringtextThe text for recognize.
stringthemesTypeThe themes type. It can be general or detailed. The detailed is not support now.
intmaxThemesThe maximum count of the themes.
intrelevanceThe minimum relevance for the themes.

Returns: The string which contains the all suitable themes written via separator.

CaptchaRecognition

Method

string CaptchaRecognition(string dllName, String[] captchas64Str, string parameters, bool asyncRecognize)

Recognizes the captcha through the specified DLL library.

Parameters

TypeNameDescription
stringdllNameThe path to DLL library.
String[]captchas64StrAn array of captures an array of strings.
stringparametersThe recognition parameters.
boolasyncRecognizetrue if need async way to recognize; otherwise and default, false.

Returns: The recognition result or id of async task.

 

WaitCaptchaRecognition

Method

string WaitCaptchaRecognition(string id)

Wait the reconition task with specified id.

Parameters

TypeNameDescription
stringidThe id of async revognition task.

Returns: The recognition result.

Example

public static int Execute(Instance instance)
            {
                instance.ClearCookie();
             
                Tab tb = instance.MainTab;
                if ((tb.IsVoid) || (tb.IsNull)) return -1;
                if (tb.IsBusy) tb.WaitDownloading();
                tb.Navigate("http://lessons.zennolab.com/ru/advanced");
                if (tb.IsBusy) tb.WaitDownloading();
             
                HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("img", "fulltag", "img", "text", 0);
             
                string id = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "", true);
             
                // some more action
                string res = ZennoPoster.WaitCaptchaRecognition(id);
                he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
                he.SetValue(res, "Middle", false);
                        
                return 0;
            }

Example2

public static function Execute($instance)
            {
                $instance->ClearCookie();
             
                $tb = $instance->MainTab;
                if (($tb->IsVoid) || ($tb->IsNull)) return -1;
                if ($tb->IsBusy) $tb->WaitDownloading();
                $tb->Navigate("http://lessons.zennolab.com/ru/advanced");
                if ($tb->IsBusy) $tb->WaitDownloading();
             
                $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("img", "fulltag", "img", "text", 0);
             
                $id = ZennoPoster::CaptchaRecognition("MonkeyEnter.dll", $he->DrawToBitmap(true), "", true);
             
                // some more action
                $res = ZennoPoster::WaitCaptchaRecognition($id);
                $he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("recaptcha_response_field");
                $he->SetValue($res, "Middle", false);
                        
                return 0;
            }

GetProxy

Method

string GetProxy(string filterName, bool canonical)

Returns the proxy with the removal.

Parameters

TypeNameDescription
stringfilterNameThe name of the filter.
boolcanonicaltrue if need to get canonical format of address; otherwise and default, false.

Returns: If “canonical” is false returns a string of the format “ip:port:isSocks”; otherwise returns a string of the format “protocol://login:password@ip:port”. Default value of “canonical” is “false”.

Example

var proxy = ZennoPoster.GetProxy("filterName");

Example2

$proxy = ZennoPoster::GetProxy("filterName");

GetProxyWithOutDelete

Method

string GetProxyWithOutDelete(string filterName, bool canonical)

Returns the a proxy without removing it.

Parameters

TypeNameDescription
stringfilterNameThe name of the filter.
boolcanonicaltrue if need to get canonical format of address; otherwise and default, false.

Returns: If “canonical” is false returns a string of the format “ip:port:isSocks”; otherwise returns a string of the format “protocol://login:password@ip:port”. Default value of “canonical” is “false”.

Example

var proxy = ZennoPoster.GetProxyWithOutDelete("filterName");

Example2

$proxy = ZennoPoster::GetProxyWithOutDelete("filterName");

MailConfirm

Method

string MailConfirm(string timeoutSec, string login, string pass, string server, int port, bool useSSL, bool useHTML, bool useIMAP, bool removeMessages, string identityRegExp, string parserRegExp, int machNum, bool throwsException, String[] imapFolderNames, string proxyString, int messageCountForLoad)

Returns the text the resulting after handling mail.

Parameters

TypeNameDescription
stringtimeoutSecTimeout specified in seconds. Three in a row above the number recorded by ”;“.
stringloginThe login for mail.
stringpassThe password for mail.
stringserverThe mail server.
intportThe server port.
booluseSSLtrue if use SSL; otherwise, false.
booluseHTMLtrue if parse HTML; otherwise, false.
booluseIMAPtrue if use IMAP; otherwise, false.
boolremoveMessagestrue if remove messages; otherwise, false.
stringidentityRegExpThe regular expression to identify email.
stringparserRegExpThe regular expression for select the contents of email.
intmachNumNumber of match.
boolthrowsExceptiontrue if need to throw exceptions; otherwise and default, false. Standart types of exeption contains in CommandCenter.Exceptions.Mail namespace.
String[]imapFolderNamesAn array of names of imap folders.
stringproxyStringProxy string in format: login:pass@ip:port OR ip:port.
intmessageCountForLoadMaximum number of messages for loading from every selected folder for every time.

Returns: The result of processing emails.

Example

try
            {
                var res = ZennoPoster.MailConfirm("15;30;60", {email}, {password}, {server}, {port}, true, true, true, false, {identityRexExp}, {parseRegExp}, 0, true);
            }
            catch(CommandCenter.Exceptions.Mail.ConnectionException ex)
            {
                // do something when connection to server failed
            }
            catch(CommandCenter.Exceptions.Mail.InvalidEmailCredentialException ex)
            {
                // do something when login/password was wrong
            }
            catch(CommandCenter.Exceptions.Mail.EmailNotFoundException ex)
            {
                // do something when email has not been found
            }
            catch(Exception ex)
            {
                // other exceptions
            }

Example2

$res = ZennoPoster::MailConfirm("15;30;60", {email}, {password}, {server}, {port}, true, true, true, false, {identityRexExp}, {parseRegExp}, 0);

ValidateEmail

Method

void ValidateEmail(string login, string pass, string proxyString)

Validate Email address using login and password.

Parameters

TypeNameDescription
stringloginThe login for mail.
stringpassThe password for mail.
stringproxyStringProxy string in format: login:pass@ip:port OR ip:port.

Example

try 
            {
                ZennoPoster.ValidateEmail({email}, {password});
            }
            catch
            {
                // Email not valid!
            }

Example2

try 
            {
                $res = ZennoPoster::ValidateEmail({email}, {password});
            }
            catch(Exception $e) 
            { 
                // email not valid 
            }

ValidateEmail

Method

void ValidateEmail(string login, string pass, string server, int port, bool useSSL, bool useIMAP, string proxyString)

Validate Email address using extended parameters.

Parameters

TypeNameDescription
stringloginThe login for mail.
stringpassThe password for mail.
stringserverThe mail server.
intportThe server port.
booluseSSLtrue if use SSL; otherwise, false.
booluseIMAPtrue if use IMAP; otherwise, false.
stringproxyStringProxy string in format: login:pass@ip:port OR ip:port.

Example

try 
            {
                ZennoPoster.ValidateEmail({email}, {password}, {server}, {port}, true, true);
            }
            catch
            {
                // Email not valid!
            }

Example2

try 
            {
                $res = ZennoPoster::ValidateEmail({email}, {password}, {server}, {port}, true, true);
            }
            catch(Exception $e)
            { 
                // email not valid 
            }

BulkMailDownload

Method

Tuple`4[] BulkMailDownload(string login, string pass, string server, int port, bool useSSL, EmailProtocol protocol, int lastHours, int maxCount, bool deleteMessages, string proxyString, bool throwException)

Downloads the messages from the specified account.

Parameters

TypeNameDescription
stringloginThe login for mail (usualy your email address).
stringpassThe password for mail.
stringserverThe mail server. Default value is blank, ZennoPoster will try to determine your the settings.
intportThe server port. Default value is 143
booluseSSLtrue if use SSL; otherwise, false. Default value is true
EmailProtocolprotocolIMAP or POP3. Default value is IMAP.
intlastHoursIf message older than specified amount of hours will not be returned. Default value is 2 hours
intmaxCountMax count of messages. Default value is 100.
booldeleteMessagestrue if remove messages; otherwise, false. Default value is false.
stringproxyStringProxy string in format: login:pass@ip:port OR ip:port.
boolthrowExceptiontrue if have to throw the error exception; otherwise, false. The default value is false.

Returns: tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message with headers, tuple.Item4 - text message with headers

Example

// download all messages from gmail via IMAP
            Tuple<string, string, string, string>[] allMails;
            allMails = ZennoPoster.BulkMailDownload("micosesus1979@gmail.com", 
                   "ххххххх", "imap.gmail.com", 993, true,
                   ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.IMAP, 
                   24*100, 20, false);
             
            // loop fo all messages
            foreach(Tuple<string, string, string, string> tuple in allMails)
            {
                // TODO Something useful with messages
                // tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
            }

Example2

// download all messages from gmail with auto settings detection for last 100 days.
            Tuple<string, string, string, string>[] allMails;
            allMails = ZennoPoster.BulkMailDownload("superuser@gmail.com", "хххххххххх", lastHours: 24*100);
             
            // loop fo all messages
            foreach(Tuple<string, string, string, string> tuple in allMails)
            {
                // TODO Something useful with messages
                // tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
            }

Example3

// download all messages from yandex via POP3 and add results to the table
            Tuple<string, string, string, string>[] allMails;
            allMails = ZennoPoster.BulkMailDownload("superuser@yandex.ru", 
                   "ххххххххххх", "pop.yandex.ru", 995, true,
                   ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3, 
                   24*100, 20, false);
             
            // loop fo all messages
            foreach(Tuple<string, string, string, string> tuple in allMails)
            {
                // adding messages to the table called Tabl1
                // tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
                  List<string> tmp = new List<string>();
                   tmp.Add(tuple.Item1);
                   tmp.Add(tuple.Item2);
                   tmp.Add(tuple.Item3);
                   tmp.Add(tuple.Item4);
                   project.Tables["Tabl1"].AddRow(tmp);
            }

FtpDownload

Method

void FtpDownload(string host, int port, string protocol, string login, string pass, string proxy, string name, string localPath)

Download the file

Parameters

TypeNameDescription
stringhostAddress of the FTP server.
intportPort of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginLogin of the FTP server
stringpassPassword of the FTP server
stringproxyProxy string in format: login:pass@ip:port OR ip:port
stringnameFile name.
stringlocalPathDestination path.

Example

var list = new System.Collections.Generic.List<string>(ZennoPoster.FtpGetList({host}, {port}, {login}, {password}, {proxy}, "", false, false));
            foreach(var item in list)
                ZennoPoster.FtpDownload({host}, {port}, {protocol}, {login}, {password}, {proxy}, item, {directoryToSavePath});

Example2

$list = new System::Collections::Generic::List<string>(ZennoPoster::FtpGetList({host}, {port}, {login}, {password}, {proxy}, "", false, false));
            foreach($item as $list)
                ZennoLab\CommandCenter\ZennoPoster::FtpDownload({host}, {port}, {protocol}, {login}, {password}, {proxy}, $item, {directoryToSavePath});

FtpUploadFile

Method

void FtpUploadFile(string host, int port, string protocol, string login, string pass, string proxy, string serverPath, string localPath)

Uploads the specified file.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringserverPathThe destination path.
stringlocalPathThe path to the file.

Example

ZennoPoster.FtpUploadFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryToUploadPath}, {filePath});

Example2

ZennoLab\CommandCenter\ZennoPoster::FtpUploadFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryToUploadPath}, {filePath});

FtpUploadDirectory

Method

void FtpUploadDirectory(string host, int port, string protocol, string login, string pass, string proxy, string serverPath, string localPath, bool recursive, bool uncludeRootName)

Uploads the specified directory.

This method uploads directory and overwrite all exit items.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringserverPathThe destination path.
stringlocalPathThe path to the file.
boolrecursiveThe true for uploading all subdirectories, and files in localPath; otherwise, false.
booluncludeRootNameThe true for include root directory name; otherwise, false.

Example

// upload all items from local directory to the directory with same name on ftp server
            ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
             
            // upload all items from local directory to the with path "ftp_path"
            ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);

Example2

// upload all items from local directory to the directory with same name on ftp server
            ZennoLab\CommandCenter\ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
             
            // upload all items from local directory to the with path "ftp_path"
            ZennoLab\CommandCenter\ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);

FtpDeleteFile

Method

void FtpDeleteFile(string host, int port, string protocol, string login, string pass, string proxy, string name)

Delete the file.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringnameThe file name.

Example

ZennoPoster.FtpDeleteFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {filePath});

Example2

ZennoLab\CommandCenter\ZennoPoster::FtpDeleteFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {filePath});

FtpDeleteDirectory

Method

void FtpDeleteDirectory(string host, int port, string protocol, string login, string pass, string proxy, string name)

Delete the directory.

This method delete the directory even if specified directory contains others directories or files.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringnameThe directory name.

Example

ZennoPoster.FtpDeleteDirectory({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryName});

Example2

ZennoLab\CommandCenter\ZennoPoster::FtpDeleteDirectory({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryName});

FtpCreateDirectory

Method

void FtpCreateDirectory(string host, int port, string protocol, string login, string pass, string proxy, string name)

Create a directory with the specified name.

The parameter “name” can be directory name (for example: Folder) or directory path (for example: Folder\SubFolder). There are two ways specify the directory path. See example.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringnameThe directory name.

Example

// create a new directory with name "newDirectory" on "host_name"
            ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "newDirectory");
            // create a new directory with name "NewDirectory\newDirectory" on "host_name"
            ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory\\newDirectory");
            // or this way
            ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory/newDirectory");

Example2

// create a new directory with name "newDirectory" on "host_name"
            ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "newDirectory");
            // create a new directory with name "NewDirectory\newDirectory" on "host_name"
            ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory\\newDirectory");
            // or this way
            ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory/newDirectory");

FtpChmode

Method

void FtpChmode(string host, int port, string protocol, string login, string pass, string proxy, string serverPath, string mode)

Changes the access mode of specified ftp item.

For changing mode on ftp server you should make sure that current server support the “SITE CHMOD” command otherwise, this operation can not be performed. The specified item can be file or directory. In case if specified item is the directory, the mode will be changed only for this ftp item, all internal files and subdirectories will not change the mode.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringserverPathThe path of ftp item.
stringmodeThe mode for specified item. This a string value can be empty, in this case the mode of item will be “000”.

Example

// change mode for file located on path MyFolder\MyTXTFile.txt
            ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MyTXTFile.txt", "774");
            // change mode for directory located on path MyFolder\MySubFolder
            ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MySubFolder", "755");

Example2

// change mode for file located on path MyFolder\MyTXTFile.txt
            ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MyTXTFile.txt", "774");
            // change mode for directory located on path MyFolder\MySubFolder
            ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MySubFolder", "755");

FtpGetList

Method

IEnumerable<string> FtpGetList(string host, int port, string protocol, string login, string pass, string proxy, string directoryName, bool recursive, bool includeDirectory)

Returns all files in the directory.

Parameters

TypeNameDescription
stringhostThe address of the FTP server.
intportThe port of the FTP server.
stringprotocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.
stringloginThe login of the FTP server.
stringpassThe password of the FTP server.
stringproxyThe proxy string in format: login:pass@ip:port OR ip:port.
stringdirectoryNameThe directory name.
boolrecursiveThe true if use recursion; otherwise, false.
boolincludeDirectoryThe true if use subdirectories; otherwise, false.

Returns: The list of all files and directories represented by collection of the IEnumerable interface.

Example

var list = new System.Collections.Generic.List<string>(ZennoPoster.FtpGetList({host}, {port}, {protocol}, {login}, {password}, {proxy}, "", false, false));

Example2

$list = new System::Collections::Generic::List<string>(ZennoLab\CommandCenter\ZennoPoster::FtpGetList({host}, {port}, {protocol}, {login}, {password}, {proxy}, "", false, false));

ImageProcessingUntreatedFromScreenshot

Method

void ImageProcessingUntreatedFromScreenshot(int instancePort, string path, int quality, string exif)

Untreated image from screenshot.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringpathThe save file path.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}
 

Example

// image without processing 
            ZennoPoster.ImageProcessingUntreatedFromScreenshot(instance.Port, "C:\\ResultImage.jpeg");

Example2

// image without processing 
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingUntreatedFromScreenshot($instance->Port, "C:\\ResultImage.jpeg");

ImageProcessingUntreatedFromUrl

Method

void ImageProcessingUntreatedFromUrl(string url, string savePath, int quality, string exif)

Untreated image from url.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}
 

Example

// image without processing 
            ZennoPoster.ImageProcessingUntreatedFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg");

Example2

// image without processing 
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingUntreatedFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg");

ImageProcessingUntreatedFromFile

Method

void ImageProcessingUntreatedFromFile(string filePath, string savePath, int quality, string exif)

Untreated image from file.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}
 

Example

// image without processing 
            ZennoPoster.ImageProcessingUntreatedFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg");

Example2

// image without processing 
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingUntreatedFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg");

ImageProcessingResizeFromScreenshot

Method

void ImageProcessingResizeFromScreenshot(int instancePort, string savePath, int width, int height, string units, bool keep, bool notIncImage, int quality, string exif)

Performs resizing of the image from screenshot.

The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
intwidthA new width of the image.
intheightA new height of the image.
stringunitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
boolkeepIf need to keep the aspect ratio then “true”; otherwise “false”.
boolnotIncImageIf not increase size of the image then “true”; otherwise “false”.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// resize image from screenshot, the width and height in pixel
            ZennoPoster.ImageProcessingResizeFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
             
            // resize image from screenshot, the width and height in percentage
            ZennoPoster.ImageProcessingResizeFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);

Example2

// resize image from screenshot, the width and height in pixel
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
             
            // resize image from screenshot, the width and height in percentage
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);

ImageProcessingResizeFromUrl

Method

void ImageProcessingResizeFromUrl(string url, string savePath, int width, int height, string units, bool keep, bool notIncImage, int quality, string exif)

Performs resizing of the image from url.

The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
intwidthA new width of the image.
intheightA new height of the image.
stringunitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
boolkeepIf need to keep the aspect ratio then “true”; otherwise “false”.
boolnotIncImageIf not increase size of the image then “true”; otherwise “false”.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// resize image from url, the width and height in pixel
            ZennoPoster.ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
             
            // resize image from url, the width and height in percentage
            ZennoPoster.ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);

Example2

// resize image from url, the width and height in pixel
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
             
            // resize image from url, the width and height in percentage
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);

ImageProcessingResizeFromFile

Method

void ImageProcessingResizeFromFile(string filePath, string savePath, int width, int height, string units, bool keep, bool notIncImage, int quality, string exif)

Performs resizing of the image from file.

The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
intwidthA new width of the image.
intheightA new height of the image.
stringunitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
boolkeepIf need to keep the aspect ratio then “true”; otherwise “false”.
boolnotIncImageIf not increase size of the image then “true”; otherwise “false”.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// resize image from file, the width and height in pixel
            ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
             
            // resize image from file, the width and height in percentage
            ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);

Example2

// resize image from file, the width and height in pixel
            ZennoLab\CommandCenter\ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
             
            // resize image from file, the width and height in percentage
            ZennoLab\CommandCenter\ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);

ImageProcessingCropFromScreenshot

Method

void ImageProcessingCropFromScreenshot(int instancePort, string savePath, int leftBorder, int topBorder, int cropWidth, int cropHeight, string units, int quality, string exif)

Performs cropping of the image from screenshot.

The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
intleftBorderThe indent from left border of the image.
inttopBorderThe indent from top border of the image.
intcropWidthThe width for cropping.
intcropHeightThe height for cropping.
stringunitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// cropping image from screenshot, the width and height in pixel
            ZennoPoster.ImageProcessingCropFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
             
            // cropping image from screenshot, the width and height in percentage
            ZennoPoster.ImageProcessingCropFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");

Example2

// cropping image from screenshot, the width and height in pixel
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
             
            // cropping image from screenshot, the width and height in percentage
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromScreenshot(#instance->Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");

ImageProcessingCropFromUrl

Method

void ImageProcessingCropFromUrl(string url, string savePath, int leftBorder, int topBorder, int cropWidth, int cropHeight, string units, int quality, string exif)

Performs cropping of the image from url.

The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
intleftBorderThe indent from left border of the image.
inttopBorderThe indent from top border of the image.
intcropWidthThe width for cropping.
intcropHeightThe height for cropping.
stringunitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// cropping image from url, the width and height in pixel
            ZennoPoster.ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
             
            // cropping image from url, the width and height in percentage
            ZennoPoster.ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");

Example2

// cropping image from url, the width and height in pixel
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
             
            // cropping image from url, the width and height in percentage
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");

ImageProcessingCropFromFile

Method

void ImageProcessingCropFromFile(string filePath, string savePath, int leftBorder, int topBorder, int cropWidth, int cropHeight, string units, int quality, string exif)

Performs cropping of the image from file.

The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
intleftBorderThe indent from left border of the image.
inttopBorderThe indent from top border of the image.
intcropWidthThe width for cropping.
intcropHeightThe height for cropping.
stringunitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}
 

Example

// cropping image from file, the width and height in pixel
            ZennoPoster.ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
             
            // cropping image from file, the width and height in percentage
            ZennoPoster.ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 75, 75, "percent");

Example2

// cropping image from file, the width and height in pixel
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
             
            // cropping image from file, the width and height in percentage
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 75, 75, "percent");

ImageProcessingRotateFromScreenshot

Method

void ImageProcessingRotateFromScreenshot(int instancePort, string savePath, int angle, int quality, string exif)

Performs rotation of the image from screenshot.

The angle is specified in degrees. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
intangleAn angle of the rotation.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// the rotation of image at 45 degrees
            ZennoPoster.ImageProcessingRotateFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 45);

Example2

// the rotation of image at 45 degrees
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingRotateFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 45);

ImageProcessingRotateFromUrl

Method

void ImageProcessingRotateFromUrl(string url, string savePath, int angle, int quality, string exif)

Performs rotation of the image from url.

The angle is specified in degrees. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
intangleAn angle of the rotation.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// the rotation of image at 45 degrees
            ZennoPoster.ImageProcessingRotateFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 45);

Example2

// the rotation of image at 45 degrees
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingRotateFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 45);

ImageProcessingRotateFromFile

Method

void ImageProcessingRotateFromFile(string filePath, string savePath, int angle, int quality, string exif)

Performs rotation of the image from file.

The angle is specified in degrees. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
intangleAn angle of the rotation.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// the rotation of image at 45 degrees
            ZennoPoster.ImageProcessingRotateFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 45);

Example2

// the rotation of image at 45 degrees
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingRotateFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 45);

ImageProcessingWaterMarkTextFromScreenshot

Method

void ImageProcessingWaterMarkTextFromScreenshot(int instancePort, string savePath, string imposition, string location, string text, int transparency, string style, int offsetLeft, int offsetTop, int quality, string exif)

Adds the water mark fom text to image from screenshot.

The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
stringimpositionThe type of the imposition. It can be “horizontally” or “diagonally”.
stringlocationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
stringtextThe text of the water mark.
inttransparencyThe transparency of the water mark. The value from 0 to 100.
stringstyleThe string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue]
intoffsetLeftThe offset from left. Default value is 0.
intoffsetTopThe offset from top. Default value is 0.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// add water mark text to image from sceenshot
            ZennoPoster.ImageProcessingWaterMarkTextFromFile(instance.Port, "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);

Example2

// add water mark text to image from sceenshot
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkTextFromFile($instance->Port, "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);

ImageProcessingWaterMarkTextFromUrl

Method

void ImageProcessingWaterMarkTextFromUrl(string url, string savePath, string imposition, string location, string text, int transparency, string style, int offsetLeft, int offsetTop, int quality, string exif)

Adds the water mark fom text to image from url.

The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
stringimpositionThe type of the imposition. It can be “horizontally” or “diagonally”.
stringlocationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
stringtextThe text of the water mark.
inttransparencyThe transparency of the water mark. The value from 0 to 100.
stringstyleThe string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue]
intoffsetLeftThe offset from left. Default value is 0.
intoffsetTopThe offset from top. Default value is 0.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// add water mark text to image from url
            ZennoPoster.ImageProcessingWaterMarkTextFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);

Example2

// add water mark text to image from url
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkTextFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);

ImageProcessingWaterMarkTextFromFile

Method

void ImageProcessingWaterMarkTextFromFile(string filePath, string savePath, string imposition, string location, string text, int transparency, string style, int offsetLeft, int offsetTop, int quality, string exif)

Adds the water mark fom text to image from file.

The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
stringimpositionThe type of the imposition. It can be “horizontally” or “diagonally”.
stringlocationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
stringtextThe text of the water mark.
inttransparencyThe transparency of the water mark. The value from 0 to 100.
stringstyleThe string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue]
intoffsetLeftThe offset from left. Default value is 0.
intoffsetTopThe offset from top. Default value is 0.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// add water mark text to image from file
            ZennoPoster.ImageProcessingWaterMarkTextFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);

Example2

// add water mark text to image from file
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkTextFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);

ImageProcessingWaterMarkImageFromScreenshot

Method

void ImageProcessingWaterMarkImageFromScreenshot(int instancePort, string savePath, string imposition, string location, string path, int transparency, int offsetLeft, int offsetTop, int quality, string exif)

Adds the water mark from image to image from screenshot.

The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
stringimpositionThe type of the imposition. It can be “horizontally” or “diagonally”.
stringlocationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
stringpathThe file path of the image which will be a water mark.
inttransparencyThe transparency of the water mark. The value from 0 to 100.
intoffsetLeftThe offset from left. Default value is 0.
intoffsetTopThe offset from top. Default value is 0.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// add water mark to image from screenshot
            ZennoPoster.ImageProcessingWaterMarkImageFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);

Example2

// add water mark to image from screenshot
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkImageFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);

ImageProcessingWaterMarkImageFromUrl

Method

void ImageProcessingWaterMarkImageFromUrl(string url, string savePath, string imposition, string location, string path, int transparency, int offsetLeft, int offsetTop, int quality, string exif)

Adds the water mark from image to image from url.

The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
stringimpositionThe type of the imposition. It can be “horizontally” or “diagonally”.
stringlocationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
stringpathThe file path of the image which will be a water mark.
inttransparencyThe transparency of the water mark. The value from 0 to 100.
intoffsetLeftThe offset from left. Default value is 0.
intoffsetTopThe offset from top. Default value is 0.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// add water mark to image from url
            ZennoPoster.ImageProcessingWaterMarkImageFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);

Example2

// add water mark to image from url
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkImageFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);

ImageProcessingWaterMarkImageFromFile

Method

void ImageProcessingWaterMarkImageFromFile(string filePath, string savePath, string imposition, string location, string path, int transparency, int offsetLeft, int offsetTop, int quality, string exif)

Adds the water mark from image to image from file.

The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
stringimpositionThe type of the imposition. It can be “horizontally” or “diagonally”.
stringlocationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
stringpathThe file path of the image which will be a water mark.
inttransparencyThe transparency of the water mark. The value from 0 to 100.
intoffsetLeftThe offset from left. Default value is 0.
intoffsetTopThe offset from top. Default value is 0.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// add water mark to image from file
            ZennoPoster.ImageProcessingWaterMarkImageFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);

Example2

// add water mark to image from file
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkImageFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);

ImageProcessingMirrorFromScreenshot

Method

void ImageProcessingMirrorFromScreenshot(int instancePort, string savePath, string mirror, int quality, string exif)

Performs the mirror reflection of the image from screenshot.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
stringmirrorThe type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// performs the horizontal mirror reflection of screenshot and save it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Horizontal");
            // performs the vertical mirror reflection of screenshot and save it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Vertical");
            // performs the horizontal and vertical mirror reflection of screenshot and save it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "HorizontalVertical");

Example2

// performs the horizontal mirror reflection of screenshot and save it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Horizontal");
            // performs the vertical mirror reflection of screenshot and save it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Vertical");
            // performs the horizontal and vertical mirror reflection of screenshot and save it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "HorizontalVertical");

ImageProcessingMirrorFromUrl

Method

void ImageProcessingMirrorFromUrl(string url, string savePath, string mirror, int quality, string exif)

Performs the mirror reflection of the image from url.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
stringmirrorThe type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// performs the horizontal mirror reflection of image from url and save it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Horizontal");
            // performs the vertical mirror reflection of image from url and save it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Vertical");
            // performs the horizontal and vertical mirror reflection of image from url and save it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "HorizontalVertical");

Example2

// performs the horizontal mirror reflection of image from url and save it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Horizontal");
            // performs the vertical mirror reflection of image from url and save it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Vertical");
            // performs the horizontal and vertical mirror reflection of image from url and save it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "HorizontalVertical");

ImageProcessingMirrorFromFile

Method

void ImageProcessingMirrorFromFile(string filePath, string savePath, string mirror, int quality, string exif)

Performs the mirror reflection of image from file.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
stringmirrorThe type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive.
intqualityThe image quality. The value from 0 to 100. Default value is 100.
stringexifThe Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName}

Example

// performs the horizontal mirror reflection of oldImage.jpg and saves it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Horizontal");
            // performs the vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Vertical");
            // performs the horizontal and vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
            ZennoPoster.ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "HorizontalVertical");

Example2

// performs the horizontal mirror reflection of oldImage.jpg and saves it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Horizontal");
            // performs the vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Vertical");
            // performs the horizontal and vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
            ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "HorizontalVertical");

ImageProcessingClearExifFromScreenshot

Method

void ImageProcessingClearExifFromScreenshot(int instancePort, string savePath, int quality)

Performs clearing all EXIF tags in metadata of image loaded from screenshot.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
intinstancePortThe port of the instance.
stringsavePathThe save file path.
intqualityThe image quality. The value from 0 to 100. Default value is 100.

Example

// clear exif for image from screenshot
            ZennoPoster.ImageProcessingClearExifFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100);

Example2

// clear exif for image from screenshot
            ZennoPoster::ImageProcessingClearExifFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100);

ImageProcessingClearExifFromUrl

Method

void ImageProcessingClearExifFromUrl(string url, string savePath, int quality)

Performs clearing all EXIF tags in metadata of image loaded from url.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringurlThe url of the image.
stringsavePathThe save file path.
intqualityThe image quality. The value from 0 to 100. Default value is 100.

Example

// clear exif for image from url
            ZennoPoster.ImageProcessingClearExifFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100);

Example2

// clear exif for image from url
            ZennoPoster::ImageProcessingClearExifFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100);

ImageProcessingClearExifFromFile

Method

void ImageProcessingClearExifFromFile(string filePath, string savePath, int quality)

Performs clearing all EXIF tags in metadata of image loaded from file.

If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.

Parameters

TypeNameDescription
stringfilePathThe file path of the image for processing.
stringsavePathThe save file path.
intqualityThe image quality. The value from 0 to 100. Default value is 100.

Example

// clear exif for image from file
            ZennoPoster.ImageProcessingClearExifFromFile("C:\\ImageForClear.jpeg", "C:\\ResultImage.jpeg", 100);

Example2

// clear exif for image from file
            ZennoPoster::ImageProcessingClearExifFromFile("C:\\ImageForClear.jpeg", "C:\\ResultImage.jpeg", 100);

AddTask

Method

void AddTask(string task)

Add a new task.

Parameters

TypeNameDescription
stringtaskThe new task to add in xml format.

Example

// Create a task in xml format
            var task =
            @"<Id>{guid}</Id>
            <Name>{name}</Name>
            <CreateTime>{date DD.MM.YYYY hh:mm:ss}</CreateTime>
            <ExecutionSettings>    
                <LimitOfThreads>1</LimitOfThreads>
                <MaxAllowOfThreads>0</MaxAllowOfThreads>
                <DoneSuccessfully>0</DoneSuccessfully>
                <DoneAll>0</DoneAll>
                <NumberOfTries>0</NumberOfTries>
                <LastNumberOfTries>0</LastNumberOfTries>
                <Priority>50</Priority>
                <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
                <Status>Newbie</Status>
                <ProxyLabels></ProxyLabels>
                <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
                <GroupLabels>Без метки</GroupLabels>
                <GroupStates>Выполнены</GroupStates>
                <MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
                <MaxNumOfFailStop>-1</MaxNumOfFailStop>
                <NumOfFailStop>0</NumOfFailStop>
            </ExecutionSettings>
            <Scheduler7Settings>
            	<IsActive>{True, False}</IsActive>
            	<ExecutePeriod>{OneTime, EveryDay, EveryWeek, EveryMonth, OnDemand}</ExecutePeriod> 
            	
            	<DaysOfWeek>{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}</DaysOfWeek> 
            	
            	<DaysOfMonth>1-5,10,20</DaysOfMonth> 
            	 
            	<FileName>C:\Program Files\ZennoLab\signalFile.txt</FileName><IsNeedDeleteFile>{True, False}</IsNeedDeleteFile>
            	<StartDateType>{Immediately, OnDate}</StartDateType> 
            	
            	<StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate> 
            	<AttemptsRange>{5, 5 -10}</AttemptsRange> <IsClearSuccess>{True, False}</IsClearSuccess> 
            	
            	<Intervals>{09:00,12:00 - 17:00}</Intervals> 
            	<RepeatType>{Continued, ContinuedWithPause, Regularly, Count}</RepeatType> 
            	
            	<RepeatCountDayRange>{1, 5 -10}</RepeatCountDayRange>
            	<EndDateType>{Infinity, OnDate, Count}</EndDateType> 
            	
            	<RepeatCountTotalRange>{50, 75-100}</RepeatCountTotalRange> 
            	 
            	<EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>
            </Scheduler7Settings>
            <Project>
                <ProjectFileLocation>{path}</ProjectFileLocation>
                <ProjectType>Assembly</ProjectType>
            </Project>";
            // Add the task
            ZennoPoster.AddTask(task);

RemoveTask

Method

void RemoveTask(Guid id)

Remove the task

Parameters

TypeNameDescription
GuididId of task to remove.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, remove the task
                    ZennoPoster.RemoveTask(id);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, remove the task
                    ZennoPoster::RemoveTask($id);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

GetTaskInfo

Method

string GetTaskInfo(Guid id)

Get the information of task

Parameters

TypeNameDescription
GuididId of task to start.

Returns: Task information in xml format.

Example

// Gets information of task from the known task's id
            var task = ZennoPoster.GetTaskInfo(id);

Example2

// Gets information of task from the known task's id
            $task = ZennoPoster::GetTaskInfo($id);

GetTaskInfo

Method

string GetTaskInfo(string projectPath)

Get the information of task

Parameters

TypeNameDescription
stringprojectPathPath to project of task

Returns: Task information in xml format.

Example

// Gets information of task from the known task's project path
            var task = ZennoPoster.GetTaskInfo(path);

Example2

// Gets information of task from the known task's project path
            $task = ZennoPoster::GetTaskInfo($path);

StopTask

Method

void StopTask(Guid id)

Stop the task by id.

Parameters

TypeNameDescription
GuididId of task to stop.

Example2

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, stop the task
                    ZennoPoster.StopTask(id);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, stop the task
                    ZennoPoster::StopTask($id);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

StopTask

Method

void StopTask(string name)

Stop the task by name.

Parameters

TypeNameDescription
stringnameName of task to stop. Finds the first occurrence.

Example2

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, stop first task with this name
                    ZennoPoster.StopTask(name);
                else
                    throw new FormatException("Name is empty");
            }

Example

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, stop first task with this name
                    ZennoPoster::StopTask($name);
                else
                    throw new FormatException("Name is empty");
            }

InterruptTask

Method

void InterruptTask(Guid id)

Interrupt the task by id.

Parameters

TypeNameDescription
GuididId of task to interrupt.

Example2

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, interrupt the task
                    ZennoPoster.InterruptTask(id);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, interrupt the task
                    ZennoPoster::InterruptTask($id);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

InterruptTask

Method

void InterruptTask(string name)

Interrupt the task by name.

Parameters

TypeNameDescription
stringnameName of task to interrupt. Finds the first occurrence.

Example2

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, interrupt first task with this name
                    ZennoPoster.InterruptTask(name);
                else
                    throw new FormatException("Name is empty");
            }

Example

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, interrupt first task with this name
                    ZennoPoster::InterruptTask($name);
                else
                    throw new FormatException("Name is empty");
            }

StartTask

Method

void StartTask(Guid id)

Start the task by id.

Parameters

TypeNameDescription
GuididId of task to start.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, start the task
                    ZennoPoster.StartTask(id);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, start the task
                    ZennoPoster::StartTask($id);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

StartTask

Method

void StartTask(string name)

Start the task by name.

Parameters

TypeNameDescription
stringnameName of task to start. Finds the first occurrence.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, start first task with this name
                    ZennoPoster.StartTask(name);
                else
                    throw new FormatException("Name is empty");
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, start first task with this name
                    ZennoPoster::StartTask($name);
                else
                    throw new FormatException("Name is empty");
            }

AddTries

Method

void AddTries(Guid id, int count)

Adds tries to the task

Parameters

TypeNameDescription
GuididId of task.
intcountCount of tries to add.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, start the task
                    ZennoPoster.AddTries(id, 30);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, start the task
                    ZennoPoster::AddTries($id, 30);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

AddTries

Method

void AddTries(string name, int count)

Adds tries to the task

Parameters

TypeNameDescription
stringnameName of task. Finds the first occurrence.
intcountCount of tries to add.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, adds tries to first task with this name
                    ZennoPoster.AddTries(name, 30);
                else
                    throw new FormatException("Name is empty");
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, adds tries to first task with this name
                    ZennoPoster::AddTries($name, 30);
                else
                    throw new FormatException("Name is empty");
            }

SetTries

Method

void SetTries(Guid id, int count)

Sets tries to the task by id.

Parameters

TypeNameDescription
GuididId of task.
intcountCount of tries to set.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, start the task
                    ZennoPoster.SetTries(id, 50);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, start the task
                    ZennoPoster::SetTries($id, 50);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

SetMaxThreads

Method

void SetMaxThreads(Guid id, int count)

Sets max threads to the task by id.

Parameters

TypeNameDescription
GuididId of task.
intcountCount of tries to set.

SetTries

Method

void SetTries(string name, int count)

Sets tries to the task by name.

Parameters

TypeNameDescription
stringnameName of task. Finds the first occurrence.
intcountCount of tries to set.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, sets tries to first task with this name
                    ZennoPoster.SetTries(name, 50);
                else
                    throw new FormatException("Name is empty");
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, sets tries to first task with this name
                    ZennoPoster::SetTries($name, 50);
                else
                    throw new FormatException("Name is empty");
            }

SetMaxThreads

Method

void SetMaxThreads(string name, int count)

Sets max threads to the task by name.

Parameters

TypeNameDescription
stringnameName of task. Finds the first occurrence.
intcountCount of tries to set.

ClearSuccess

Method

void ClearSuccess(Guid id)

Clear success of the task by id.

Parameters

TypeNameDescription
GuididId of task.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, clear success of the task
                    ZennoPoster.ClearSuccess(id);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, clear success of the task
                    ZennoPoster::ClearSuccess($id);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

ClearFails

Method

void ClearFails(Guid id)

Clear fails of the task by id.

Parameters

TypeNameDescription
GuididId of task.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task id
                var xpath = "Task/Id";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string result;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    result = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                Guid id;
                // Parse guid
                if (Guid.TryParse(result, out id))
                    // If ok, clear fails of the task
                    ZennoPoster.ClearFails(id);
                else
                    throw new FormatException(string.Format("{0} is not guid", result));
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task id
                $xpath = "Task/Id";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $result;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $result = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                $id = "";
                // Parse guid
                if (Guid::TryParse($result, $id))
                    // If ok, clear fails of the task
                    ZennoPoster::ClearFails($id);
                else
                    throw new FormatException(String::Format("{0} is not guid", $result));
            }

ClearSuccess

Method

void ClearSuccess(string name)

Clear success of the task by name.

Parameters

TypeNameDescription
stringnameName of task. Finds the first occurrence.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, clears success for first task with this name
                    ZennoPoster.ClearSuccess(name);
                else
                    throw new FormatException("Name is empty");
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, clears success for first task with this name
                    ZennoPoster::ClearSuccess($name);
                else
                    throw new FormatException("Name is empty");
            }

ClearFails

Method

void ClearFails(string name)

Clear fails of the task by name.

Parameters

TypeNameDescription
stringnameName of task. Finds the first occurrence.

Example

// Gets list of tasks
            var tasksList = new List<string>(ZennoPoster.TasksList);
             
            // Check the presence of items in the list
            if(tasksList.Count != 0)
            {
                // Select ane item
                var source = tasksList[0];
                // Sets path to task name
                var xpath = "Task/Name";
             
                // Gets guid string from task data
                var doc = new System.Xml.XmlDocument();
                doc.LoadXml("<Task>" + source + "</Task>");
                string name;
                var node = doc.SelectSingleNode(xpath);
                if (node != null)
                    name = node.InnerXml;
                else 
                    throw new InvalidDataException(string.Format("{0} is null", xpath));
             
                if(!String.IsNullOrEmpty(name))
                    // If ok, clears fails for first task with this name
                    ZennoPoster.ClearFails(name);
                else
                    throw new FormatException("Name is empty");
            }

Example2

// Gets list of tasks
            $tasksList = new List<string>(ZennoPoster::TasksList);
             
            // Check the presence of items in the list
            if(tasksList->Count != 0)
            {
                // Select ane item
                $source = $tasksList[0];
                // Sets path to task name
                $xpath = "Task/Name";
             
                // Gets guid string from task data
                $doc = new System\Xml\XmlDocument();
                $doc->LoadXml("<Task>" + $source + "</Task>");
                $name;
                $node = $doc->SelectSingleNode($xpath);
                if ($node != null)
                    $name = $node->InnerXml;
                else 
                    throw new InvalidDataException(String::Format("{0} is null", $xpath));
             
                if (String::IsNullOrEmpty($name))
                    // If ok, clears fails for first task with this name
                    ZennoPoster::ClearFails($name);
                else
                    throw new FormatException("Name is empty");
            }

SetExecutionSettings

Method

void SetExecutionSettings(Guid id, string executionSettings)

Set the execution settings by id.

Parameters

TypeNameDescription
GuididId task to change execution settings.
stringexecutionSettingsNew execution settings to change in xml format.

Example

// Create execution settings in xml format
            var settings =
            @"<LimitOfThreads>1</LimitOfThreads>
            <MaxAllowOfThreads>0</MaxAllowOfThreads>
            <DoneSuccessfully>0</DoneSuccessfully>
            <DoneAll>0</DoneAll>
            <NumberOfTries>0</NumberOfTries>
            <LastNumberOfTries>0</LastNumberOfTries>
            <Priority>50</Priority>
            <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
            <Status>Newbie</Status>
            <ProxyLabels></ProxyLabels>
            <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
            <GroupLabels>Без метки</GroupLabels>
            <GroupStates>Выполнены</GroupStates>
            <MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
            <MaxNumOfFailStop>-1</MaxNumOfFailStop>
            <NumOfFailStop>0</NumOfFailStop>";
            // Set the settings to the task with known id
            var id = Guid.Empty;
            ZennoPoster.SetExecutionSettings(id, settings);

Example2

// Create execution settings in xml format
            $settings =
            @"<LimitOfThreads>1</LimitOfThreads>
            <MaxAllowOfThreads>0</MaxAllowOfThreads>
            <DoneSuccessfully>0</DoneSuccessfully>
            <DoneAll>0</DoneAll>
            <NumberOfTries>0</NumberOfTries>
            <LastNumberOfTries>0</LastNumberOfTries>
            <Priority>50</Priority>
            <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
            <Status>Newbie</Status>
            <ProxyLabels></ProxyLabels>
            <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
            <GroupLabels>Без метки</GroupLabels>
            <GroupStates>Выполнены</GroupStates>
            <MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
            <MaxNumOfFailStop>-1</MaxNumOfFailStop>
            <NumOfFailStop>0</NumOfFailStop>";
            // Set the settings to the task with known id
            $id = Guid::Empty;
            ZennoPoster::SetExecutionSettings($id, $settings);

SetExecutionSettings

Method

void SetExecutionSettings(string name, string executionSettings)

Set the execution settings by name.

Parameters

TypeNameDescription
stringnameName of task to change execution settings. Finds the first occurrence.
stringexecutionSettingsNew execution settings to change in xml format.

Example

// Create execution settings in xml format
            var settings =
            @"<LimitOfThreads>1</LimitOfThreads>
            <MaxAllowOfThreads>0</MaxAllowOfThreads>
            <DoneSuccessfully>0</DoneSuccessfully>
            <DoneAll>0</DoneAll>
            <NumberOfTries>0</NumberOfTries>
            <LastNumberOfTries>0</LastNumberOfTries>
            <Priority>50</Priority>
            <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
            <Status>Newbie</Status>
            <ProxyLabels></ProxyLabels>
            <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
            <GroupLabels>Без метки</GroupLabels>
            <GroupStates>Выполнены</GroupStates>
            <MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
            <MaxNumOfFailStop>-1</MaxNumOfFailStop>
            <NumOfFailStop>0</NumOfFailStop>";
            // Set the settings to first task with known name
            var name = "Name";
            ZennoPoster.SetExecutionSettings(name, settings);

Example2

// Create execution settings in xml format
            $settings =
            @"<LimitOfThreads>1</LimitOfThreads>
            <MaxAllowOfThreads>0</MaxAllowOfThreads>
            <DoneSuccessfully>0</DoneSuccessfully>
            <DoneAll>0</DoneAll>
            <NumberOfTries>0</NumberOfTries>
            <LastNumberOfTries>0</LastNumberOfTries>
            <Priority>50</Priority>
            <Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
            <Status>Newbie</Status>
            <ProxyLabels></ProxyLabels>
            <ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
            <GroupLabels>Без метки</GroupLabels>
            <GroupStates>Выполнены</GroupStates>
            <MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
            <MaxNumOfFailStop>-1</MaxNumOfFailStop>
            <NumOfFailStop>0</NumOfFailStop>";
            // Set the settings to first task with known name
            $name = "Name";
            ZennoPoster::SetExecutionSettings($name, $settings);

SetSchedulerSettings

Method

void SetSchedulerSettings(Guid id, string schedulerSettings)

Set the sсheduler settings by id.

Parameters

TypeNameDescription
GuididId of task to change scheduler settings.
stringschedulerSettingsNew scheduler settings to change in xml format.

Example

// Create scheduler setting in xml format
            var settings =
            	@"<IsActive>{True, False}</IsActive>
            	<ExecutePeriod>{OneTime, EveryDay, EveryWeek, EveryMonth, OnDemand}</ExecutePeriod> 
            	
            	<DaysOfWeek>{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}</DaysOfWeek> 
            	
            	<DaysOfMonth>1-5,10,20</DaysOfMonth> 
            	 
            	<FileName>C:\Program Files\ZennoLab\signalFile.txt</FileName><IsNeedDeleteFile>{True, False}</IsNeedDeleteFile>
            	<StartDateType>{Immediately, OnDate}</StartDateType> 
            	
            	<StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate> 
            	<AttemptsRange>{5, 5 -10}</AttemptsRange> <IsClearSuccess>{True, False}</IsClearSuccess> 
            	
            	<Intervals>{09:00,12:00 - 17:00}</Intervals> 
            	<RepeatType>{Continued, ContinuedWithPause, Regularly, Count}</RepeatType> 
            	
            	<RepeatCountDayRange>{1, 5 -10}</RepeatCountDayRange>
            	<EndDateType>{Infinity, OnDate, Count}</EndDateType> 
            	
            	<RepeatCountTotalRange>{50, 75-100}</RepeatCountTotalRange> 
            	 
            	<EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>";
            // Set the setting to the task with known id
            var id = Guid.Empty;
            ZennoPoster.SetSchedulerSettings(id, settings);

SetSchedulerSettings

Method

void SetSchedulerSettings(string name, string schedulerSettings)

Set the sсheduler settings by name.

Parameters

TypeNameDescription
stringnameName of task to change scheduler settings. Finds the first occurrence.
stringschedulerSettingsNew scheduler settings to change in xml format.

Example

// Create scheduler setting in xml format
            var settings =
            	@"<IsActive>{True, False}</IsActive>
            	<ExecutePeriod>{OneTime, EveryDay, EveryWeek, EveryMonth, OnDemand}</ExecutePeriod> 
            	
            	<DaysOfWeek>{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}</DaysOfWeek> 
            	
            	<DaysOfMonth>1-5,10,20</DaysOfMonth> 
            	 
            	<FileName>C:\Program Files\ZennoLab\signalFile.txt</FileName><IsNeedDeleteFile>{True, False}</IsNeedDeleteFile>
            	<StartDateType>{Immediately, OnDate}</StartDateType> 
            	
            	<StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate> 
            	<AttemptsRange>{5, 5 -10}</AttemptsRange> <IsClearSuccess>{True, False}</IsClearSuccess> 
            	
            	<Intervals>{09:00,12:00 - 17:00}</Intervals> 
            	<RepeatType>{Continued, ContinuedWithPause, Regularly, Count}</RepeatType> 
            	
            	<RepeatCountDayRange>{1, 5 -10}</RepeatCountDayRange>
            	<EndDateType>{Infinity, OnDate, Count}</EndDateType> 
            	
            	<RepeatCountTotalRange>{50, 75-100}</RepeatCountTotalRange> 
            	 
            	<EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>";
            // Set the setting to first task with known name
            var name = "Name";
            ZennoPoster.SetSchedulerSettings(name, settings);

ExportInputSettings

Method

string ExportInputSettings(Guid id)

Export the input settings

Parameters

TypeNameDescription
GuididId of task to export settings.

Returns: Input settings in xml format.

Example

// Getting GUID of the current project
            Guid id = Guid.Parse(project.TaskId);
            // Export setting in xml format
            string settings = ZennoPoster.ExportInputSettings(id);

Example2

// Export setting in xml format
            $id = System\Guid::Empty;
            $settings = ZennoLab\CommandCenter\ZennoPoster::ExportInputSettings($id);

ImportInputSettings

Method

void ImportInputSettings(Guid id, string source)

Export the input settings.

Parameters

TypeNameDescription
GuididId of task to export settings.
stringsourceNew input settings to change in xml format.

Example

// Setting GUID of the target project
            var id = Guid.Empty;
            var settings = ZennoPoster.ExportInputSettings(id);
            // Import setting in xml format
            ZennoPoster.ImportInputSettings(id, settings);

Example2

// Import setting in xml format
            $id = System\Guid::Empty;
            $settings = ZennoLab\CommandCenter\ZennoPoster::ExportInputSettings($id);
            // Import setting in xml format
            ZennoLab\CommandCenter\ZennoPoster::ImportInputSettings($id, $settings);

GetThreadsCount

Method

int GetThreadsCount()

Returns count of tasks that currently running

Returns: Count of threads.

Example

int count = ZennoPoster.GetThreadsCount();

GetThreadsCount

Method

int GetThreadsCount(string name)

Returns count of threads for certain tasks

Parameters

TypeNameDescription
stringnameName of a task.

Returns: Count of threads.

Example

int count = ZennoPoster.GetThreadsCount(taskName);

GetThreadsCount

Method

int GetThreadsCount(Guid id)

Returns count of threads for certain tasks

Parameters

TypeNameDescription
GuididId of a task.

Returns: Count of threads.

Example

int count = ZennoPoster.GetThreadsCount(taskName);