ZennoPoster

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


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

Properties

RealInstanceManagerService

Property

Service for internal use only

RealTaskManagerService

Property

Service for internal use only

AllInstances

Property

Gets array of all instances ports.

TasksList

Property

Gets the collection of tasks

Example

// Gets list of tasks
            var tasksList = ZennoPoster.TasksList;

Example2

// Gets list of tasks
            $tasksList = ZennoPoster::TasksList;

Methods

ConnectToTaskManagerService

Method

Подключиться к wcf сервису для работы с заданиями

Parameters

ПараметрОписание
serviceсервис

ConnectToInstanceManagerService

Method

Подключиться к wcf сервису для работы с инстансами

Parameters

ПараметрОписание
serviceсервис
getProcessesбрать процессы или нет

CloseConnectionWithInstanceManager

Method

Отключиться от wcf сервиса для работы с инстансами

Parameters

ПараметрОписание
service
shouldClose

CloseConnectionWithTaskManager

Method

Отключиться от wcf сервиса для работы с заданиями

Parameters

ПараметрОписание
serviceпайп
shouldCloseзакрывать сервис или нет

HttpGet

Method

Executes get request

Parameters

ПараметрОписание
urlTarget address of request.
proxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
EncodingEncoding format.
respTypeResponse type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File).
TimeoutTimeout in milliseconds of request.
CookiesCookies for request.
UserAgentUserAgent for request.
UseRedirecttrue if use redirect; otherwise, false.
MaxRedirectCountMaximum count of redirects.
AdditionalHeadersAn array of captures an array of additional headers.
DownloadPathDownload path for file.
UseOriginalUrltrue 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);

HttpGetBytes

Method

Executes get request

Parameters

ПараметрОписание
urlTarget address of request.
proxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
EncodingEncoding format.
TimeoutTimeout in milliseconds of request.
CookiesCookies for request.
UserAgentUserAgent for request.
UseRedirecttrue if use redirect; otherwise, false.
MaxRedirectCountMaximum count of redirects.
AdditionalHeadersAn array of captures an array of additional headers.
UseOriginalUrltrue if use original url; otherwise, false.

Returns: The result byte array of request.

Example

var resultHttpGetBytes = ZennoPoster.HttpGet("https://www.google.ru/", "", "UTF-8");

Example2

$resultHttpGetBytes = ZennoPoster::HttpGet("https://www.google.ru/", "", "UTF-8");

HttpPost

Method

Executes post request

Parameters

ПараметрОписание
urlTarget address of request.
contentThe content of post request.
contentPostingTypeThe type of content.
proxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
EncodingEncoding format.
respTypeResponse type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File).
TimeoutTimeout in milliseconds of request.
CookiesCookies for request.
UserAgentUserAgent for request.
UseRedirecttrue if use redirect; otherwise, false.
MaxRedirectCountMaximum count of redirects.
AdditionalHeadersAn array of captures an array of additional headers.
DownloadPathDownload path for file.
UseOriginalUrltrue 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

Executes post request

Parameters

ПараметрОписание
urlTarget address of request.
contentThe content of post request.
contentPostingTypeThe type of content.
proxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
EncodingEncoding format.
respTypeResponse type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File).
TimeoutTimeout in milliseconds of request.
CookiesCookies for request.
UserAgentUserAgent for request.
UseRedirecttrue if use redirect; otherwise, false.
MaxRedirectCountMaximum count of redirects.
AdditionalHeadersAn array of captures an array of additional headers.
DownloadPathDownload path for file.
UseOriginalUrltrue if use original url; otherwise, false.

Returns: The result of request.

HttpPostBytes

Method

Executes post request

Parameters

ПараметрОписание
urlTarget address of request.
contentThe content of post request.
contentPostingTypeThe type of content.
proxyProxy string (for example: socks5://llogin:pass@8.5.6.7:8080).
EncodingEncoding format.
TimeoutTimeout in milliseconds of request.
CookiesCookies for request.
UserAgentUserAgent for request.
UseRedirecttrue if use redirect; otherwise, false.
MaxRedirectCountMaximum count of redirects.
AdditionalHeadersAn array of captures an array of additional headers.
UseOriginalUrltrue if use original url; otherwise, false.

Returns: The result byte array of request.

Example

var resultHttpPostBytes = 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");

GetNewInstance

Method

Get the instance

Parameters

ПараметрОписание
urlPipe host of instance (127.0.0.1).
portInstance port.
addressInstance work mode.
browserTypeThe browser type. The default value is BrowserType.Firefox45.
browserArgsThe command line arguments for starting browser.

Example

var url = "";
            var port = 0;
            var address = "";
            // Gets parameters of instance
            ZennoPoster.GetNewInstance(out url, out port, out address);
            // Create new instance
            var instance = new Instance(url, port, address);

Example2

$url = "";
            $port = 0;
            $address = "";
            // Gets parameters of instance
            ZennoPoster::GetNewInstance($url, $port, $address);
            // Create new instance
            $instance = new Instance($url, $port, $address);

ShowInstance

Method

Show the instance

Parameters

ПараметрОписание
urlPipe host of instance (127.0.0.1).
portInstance port.
addressInstance 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

Hide the instance

Parameters

ПараметрОписание
urlPipe host of instance (127.0.0.1).
portInstance port.
addressInstance 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

Release the instance

Parameters

ПараметрОписание
urlPipe host of instance (127.0.0.1).
portInstance port.
addressInstance 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

Recognizes the special captcha through the specified DLL library.

Parameters

ПараметрОписание
dllNameThe path to DLL library.
instanceThe instance with captcha for recognition.
asyncRecognizetrue 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

Recognizes the captcha through the specified DLL library.

Parameters

ПараметрОписание
dllNameThe path to DLL library.
captchaThe captcha for recognition.
parametersThe recognition parameters.
asyncRecognizetrue 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

Recognizes the captcha through the specified DLL library.

Parameters

ПараметрОписание
dllNameThe path to DLL library.
captchaThe captcha for recognition.
parametersThe recognition parameters.
asyncRecognizetrue if need async way to recognize; otherwise and default, false.
confidenceThe result confidence.

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 confidence;
                 string res = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "", false, out confidence);
              
                 he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
                 he.SetValue(res, "Middle", false);
                         
                 return 0;
             }

ContextRecognition

Method

Recognizes the themes for the specified text.

Parameters

ПараметрОписание
textThe text for recognize.
themesTypeThe themes type. It can be general or detailed. The detailed is not support now.
maxThemesThe maximum count of the themes.
relevanceThe minimum relevance for the themes.

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

CaptchaRecognition

Method

Recognizes the captcha through the specified DLL library.

Parameters

ПараметрОписание
dllNameThe path to DLL library.
parametersThe recognition parameters.
captchas64StrAn array of captures an array of strings.
asyncRecognizetrue if need async way to recognize; otherwise and default, false.

Returns: The recognition result or id of async task.

 

WaitCaptchaRecognition

Method

Wait the reconition task with specified id.

Parameters

ПараметрОписание
idThe 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

Returns the proxy with the removal.

Parameters

ПараметрОписание
filterNameThe name of the filter.
canonicaltrue 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

Returns the a proxy without removing it.

Parameters

ПараметрОписание
filterNameThe name of the filter.
canonicaltrue 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

Returns the text the resulting after handling mail.

Parameters

ПараметрОписание
timeoutSecTimeout specified in seconds. Three in a row above the number recorded by ”;“.
loginThe login for mail.
passThe password for mail.
serverThe mail server.
identityRegExpThe regular expression to identify email.
parserRegExpThe regular expression for select the contents of email.
portThe server port.
useSSLtrue if use SSL; otherwise, false.
useHTMLtrue if parse HTML; otherwise, false.
useIMAPtrue if use IMAP; otherwise, false.
removeMessagestrue if remove messages; otherwise, false.
machNumNumber of match.
throwsExceptiontrue if need to throw exceptions; otherwise and default, false. Standart types of exeption contains in CommandCenter.Exceptions.Mail namespace.
imapFolderNamesAn array of names of imap folders.
proxyStringProxy string in format: login:pass@ip:port OR ip:port.
messageCountForLoadMaximum 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

Validate Email address using login and password.

Parameters

ПараметрОписание
loginThe login for mail.
passThe password for mail.
proxyStringProxy 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

Validate Email address using extended parameters.

Parameters

ПараметрОписание
loginThe login for mail.
passThe password for mail.
serverThe mail server.
portThe server port.
useSSLtrue if use SSL; otherwise, false.
useIMAPtrue if use IMAP; otherwise, false.
proxyStringProxy 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

Downloads the messages from the specified account.

Parameters

ПараметрОписание
loginThe login for mail (usualy your email address).
passThe password for mail.
serverThe mail server. Default value is blank, ZennoPoster will try to determine your the settings.
portThe server port. Default value is 143
useSSLtrue if use SSL; otherwise, false. Default value is true
protocolIMAP or POP3. Default value is IMAP.
lastHoursIf message older than specified amount of hours will not be returned. Default value is 2 hours
maxCountMax count of messages. Default value is 100.
deleteMessagestrue if remove messages; otherwise, false. Default value is false.
proxyStringProxy string in format: login:pass@ip:port OR ip:port.
throwExceptiontrue 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

Download the file

Parameters

ПараметрОписание
hostAddress of the FTP server.
portPort of the FTP server.
loginLogin of the FTP server
passPassword of the FTP server
proxyProxy string in format: login:pass@ip:port OR ip:port
nameFile name.
localPathDestination path.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

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

Uploads the specified file.

Parameters

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
serverPathThe destination path.
localPathThe path to the file.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

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

Uploads the specified directory.

This method uploads directory and overwrite all exit items.

Parameters

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
serverPathThe destination path.
localPathThe path to the file.
recursiveThe true for uploading all subdirectories, and files in localPath; otherwise, false.
uncludeRootNameThe true for include root directory name; otherwise, false.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

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

Delete the file.

Parameters

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
nameThe file name.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

Example

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

Example2

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

FtpDeleteDirectory

Method

Delete the directory.

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

Parameters

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
nameThe directory name.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

Example

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

Example2

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

FtpCreateDirectory

Method

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

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
nameThe directory name.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

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

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

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
serverPathThe path of ftp item.
modeThe mode for specified item. This a string value can be empty, in this case the mode of item will be “000”.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

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

Returns all files in the directory.

Parameters

ПараметрОписание
hostThe address of the FTP server.
portThe port of the FTP server.
loginThe login of the FTP server.
passThe password of the FTP server.
proxyThe proxy string in format: login:pass@ip:port OR ip:port.
directoryNameThe directory name.
recursiveThe true if use recursion; otherwise, false.
includeDirectoryThe true if use subdirectories; otherwise, false.
protocolThe FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”.

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

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

ПараметрОписание
pathThe save file path.
instancePortThe port of the instance.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
urlThe url of the image.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
filePathThe file path of the image for processing.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
instancePortThe port of the instance.
widthA new width of the image.
heightA new height of the image.
keepIf need to keep the aspect ratio then “true”; otherwise “false”.
unitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
notIncImageIf not increase size of the image then “true”; otherwise “false”.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
urlThe url of the image.
widthA new width of the image.
heightA new height of the image.
unitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
keepIf need to keep the aspect ratio then “true”; otherwise “false”.
notIncImageIf not increase size of the image then “true”; otherwise “false”.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
filePathThe file path of the image for processing.
widthA new width of the image.
heightA new height of the image.
unitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
keepIf need to keep the aspect ratio then “true”; otherwise “false”.
notIncImageIf not increase size of the image then “true”; otherwise “false”.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
leftBorderThe indent from left border of the image.
topBorderThe indent from top border of the image.
cropWidthThe width for cropping.
cropHeightThe height for cropping.
unitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
instancePortThe port of the instance.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
leftBorderThe indent from left border of the image.
topBorderThe indent from top border of the image.
cropWidthThe width for cropping.
cropHeightThe height for cropping.
unitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
urlThe url of the image.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
filePathThe file path of the image for processing.
savePathThe save file path.
leftBorderThe indent from left border of the image.
topBorderThe indent from top border of the image.
cropWidthThe width for cropping.
cropHeightThe height for cropping.
unitsUnits of dimension of the parameters. It can be “pixel” or “percent”.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
instancePortThe port of the instance.
angleAn angle of the rotation.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
urlThe url of the image.
angleAn angle of the rotation.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
filePathThe file path of the image for processing.
angleAn angle of the rotation.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
transparencyThe transparency of the water mark. The value from 0 to 100.
impositionThe type of the imposition. It can be “horizontally” or “diagonally”.
instancePortThe port of the instance.
locationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
textThe text of the water mark.
styleThe string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue]
offsetLeftThe offset from left. Default value is 0.
offsetTopThe offset from top. Default value is 0.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
urlThe url of the image.
transparencyThe transparency of the water mark. The value from 0 to 100.
impositionThe type of the imposition. It can be “horizontally” or “diagonally”.
locationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
textThe text of the water mark.
styleThe string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue]
offsetLeftThe offset from left. Default value is 0.
offsetTopThe offset from top. Default value is 0.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
filePathThe file path of the image for processing.
transparencyThe transparency of the water mark. The value from 0 to 100.
impositionThe type of the imposition. It can be “horizontally” or “diagonally”.
locationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
textThe text of the water mark.
styleThe string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue]
offsetLeftThe offset from left. Default value is 0.
offsetTopThe offset from top. Default value is 0.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
instancePortThe port of the instance.
impositionThe type of the imposition. It can be “horizontally” or “diagonally”.
locationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
pathThe file path of the image which will be a water mark.
transparencyThe transparency of the water mark. The value from 0 to 100.
offsetLeftThe offset from left. Default value is 0.
offsetTopThe offset from top. Default value is 0.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
urlThe url of the image.
transparencyThe transparency of the water mark. The value from 0 to 100.
impositionThe type of the imposition. It can be “horizontally” or “diagonally”.
locationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
pathThe file path of the image which will be a water mark.
offsetLeftThe offset from left. Default value is 0.
offsetTopThe offset from top. Default value is 0.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
savePathThe save file path.
filePathThe file path of the image for processing.
impositionThe type of the imposition. It can be “horizontally” or “diagonally”.
locationThe type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”.
pathThe file path of the image which will be a water mark.
transparencyThe transparency of the water mark. The value from 0 to 100.
offsetLeftThe offset from left. Default value is 0.
offsetTopThe offset from top. Default value is 0.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
mirrorThe type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive.
savePathThe save file path.
instancePortThe port of the instance.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
mirrorThe type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive.
savePathThe save file path.
urlThe url of the image.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
filePathThe file path of the image for processing.
savePathThe save file path.
mirrorThe type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive.
qualityThe image quality. The value from 0 to 100. Default value is 100.
exifThe 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

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

ПараметрОписание
qualityThe image quality. The value from 0 to 100. Default value is 100.
savePathThe save file path.
instancePortThe port of the instance.

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

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

ПараметрОписание
qualityThe image quality. The value from 0 to 100. Default value is 100.
savePathThe save file path.
urlThe url of the image.

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

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

ПараметрОписание
filePathThe file path of the image for processing.
savePathThe save file path.
qualityThe 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

Add a new task.

Parameters

ПараметрОписание
taskThe 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

Remove the task

Parameters

ПараметрОписание
idId 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

Get the information of task

Parameters

ПараметрОписание
idId 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

Get the information of task

Parameters

ПараметрОписание
projectPathPath 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

Stop the task by id.

Parameters

ПараметрОписание
idId 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

Stop the task by name.

Parameters

ПараметрОписание
nameName 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

Interrupt the task by id.

Parameters

ПараметрОписание
idId 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

Interrupt the task by name.

Parameters

ПараметрОписание
nameName 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

Start the task by id.

Parameters

ПараметрОписание
idId 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

Start the task by name.

Parameters

ПараметрОписание
nameName 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

Adds tries to the task

Parameters

ПараметрОписание
idId of task.
countCount 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

Adds tries to the task

Parameters

ПараметрОписание
nameName of task. Finds the first occurrence.
countCount 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

Sets tries to the task by id.

Parameters

ПараметрОписание
idId of task.
countCount 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

Sets max threads to the task by id.

Parameters

ПараметрОписание
idId of task.
countCount of tries to set.

SetTries

Method

Sets tries to the task by name.

Parameters

ПараметрОписание
nameName of task. Finds the first occurrence.
countCount 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

Sets max threads to the task by name.

Parameters

ПараметрОписание
nameName of task. Finds the first occurrence.
countCount of tries to set.

ClearSuccess

Method

Clear success of the task by id.

Parameters

ПараметрОписание
idId 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

Clear fails of the task by id.

Parameters

ПараметрОписание
idId 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

Clear success of the task by name.

Parameters

ПараметрОписание
nameName 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

Clear fails of the task by name.

Parameters

ПараметрОписание
nameName 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

Set the execution settings by id.

Parameters

ПараметрОписание
idId task to change execution settings.
executionSettingsNew 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

Set the execution settings by name.

Parameters

ПараметрОписание
nameName of task to change execution settings. Finds the first occurrence.
executionSettingsNew 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

Set the sсheduler settings by id.

Parameters

ПараметрОписание
idId of task to change scheduler settings.
schedulerSettingsNew 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

Set the sсheduler settings by name.

Parameters

ПараметрОписание
nameName of task to change scheduler settings. Finds the first occurrence.
schedulerSettingsNew 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

Export the input settings

Parameters

ПараметрОписание
idId 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

Export the input settings.

Parameters

ПараметрОписание
idId of task to export settings.
sourceNew 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

Returns count of tasks that currently running

Returns: Count of threads.

Example

int count = ZennoPoster.GetThreadsCount();

GetThreadsCount

Method

Returns count of threads for certain tasks

Parameters

ПараметрОписание
nameName of a task.

Returns: Count of threads.

Example

int count = ZennoPoster.GetThreadsCount(taskName);

GetThreadsCount

Method

Returns count of threads for certain tasks

Parameters

ПараметрОписание
idId of a task.

Returns: Count of threads.

Example

int count = ZennoPoster.GetThreadsCount(taskName);