ZennoPoster
Assembly: ZennoLab.CommandCenter
Full name: ZennoLab.CommandCenter.ZennoPoster
Kind: class
Represents a set methods to recognize captcha, working with mail, instances, etc.
Constructor
ZennoPoster()
Constructor
Methods
HttpGet
Method
string HttpGet(string url, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, String[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl)
Executes get request
Parameters
| Type | Name | Description |
|---|---|---|
string | url | Target address of request. |
string | proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
string | Encoding | Encoding format. |
ResponceType | respType | Response type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File). |
int | Timeout | Timeout in milliseconds of request. |
string | Cookies | Cookies for request. |
string | UserAgent | UserAgent for request. |
bool | UseRedirect | true if use redirect; otherwise, false. |
int | MaxRedirectCount | Maximum count of redirects. |
String[] | AdditionalHeaders | An array of captures an array of additional headers. |
string | DownloadPath | Download path for file. |
bool | UseOriginalUrl | true if use original url; otherwise, false. |
Returns: The result of request.
Example
var resultHttpGet = ZennoPoster.HttpGet("https://www.google.ru/", "", "UTF-8",respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);Example2
$resultHttpGet = ZennoLab\CommandCenter\ZennoPoster::HttpGet("https://www.google.ru/", "", "UTF-8", ZennoLab\InterfacesLibrary\Enums\Http\ResponceType::HeaderAndBody);HttpPost
Method
string HttpPost(string url, string content, string contentPostingType, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, String[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl)
Executes post request
Parameters
| Type | Name | Description |
|---|---|---|
string | url | Target address of request. |
string | content | The content of post request. |
string | contentPostingType | The type of content. |
string | proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
string | Encoding | Encoding format. |
ResponceType | respType | Response type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File). |
int | Timeout | Timeout in milliseconds of request. |
string | Cookies | Cookies for request. |
string | UserAgent | UserAgent for request. |
bool | UseRedirect | true if use redirect; otherwise, false. |
int | MaxRedirectCount | Maximum count of redirects. |
String[] | AdditionalHeaders | An array of captures an array of additional headers. |
string | DownloadPath | Download path for file. |
bool | UseOriginalUrl | true if use original url; otherwise, false. |
Returns: The result of request.
Example
var resultHttpPost = ZennoPoster.HttpPost("http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi",
"Comments=This+is%0D%0Asome+text%0D%0Ain+several+lines.&box=yes&hidden+field=something",
"application/x-www-form-urlencoded", "", "iso-8859-1",respType:ZennoLab.InterfacesLibrary.Enums.Http.ResponceType.HeaderAndBody);Example2
$resultHttpPost = ZennoLab\CommandCenter\ZennoPoster::HttpPost("http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi",
"Comments=This+is%0D%0Asome+text%0D%0Ain+several+lines.&box=yes&hidden+field=something",
"application/x-www-form-urlencoded", "", "iso-8859-1", ZennoLab\InterfacesLibrary\Enums\Http\ResponceType::HeaderAndBody);HttpPost
Method
string HttpPost(string url, Byte[] content, string contentPostingType, string proxy, string Encoding, ResponceType respType, int Timeout, string Cookies, string UserAgent, bool UseRedirect, int MaxRedirectCount, String[] AdditionalHeaders, string DownloadPath, bool UseOriginalUrl)
Executes post request
Parameters
| Type | Name | Description |
|---|---|---|
string | url | Target address of request. |
Byte[] | content | The content of post request. |
string | contentPostingType | The type of content. |
string | proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
string | Encoding | Encoding format. |
ResponceType | respType | Response type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File). |
int | Timeout | Timeout in milliseconds of request. |
string | Cookies | Cookies for request. |
string | UserAgent | UserAgent for request. |
bool | UseRedirect | true if use redirect; otherwise, false. |
int | MaxRedirectCount | Maximum count of redirects. |
String[] | AdditionalHeaders | An array of captures an array of additional headers. |
string | DownloadPath | Download path for file. |
bool | UseOriginalUrl | true if use original url; otherwise, false. |
Returns: The result of request.
GetNewInstance
Method
void GetNewInstance(String& url, Int32& port, String& address, BrowserType browserType, string browserArgs)
Parameters
| Type | Name | Description |
|---|---|---|
String& | url | |
Int32& | port | |
String& | address | |
BrowserType | browserType | |
string | browserArgs |
ShowInstance
Method
void ShowInstance(string url, int port, string address)
Show the instance
Parameters
| Type | Name | Description |
|---|---|---|
string | url | Pipe host of instance (127.0.0.1). |
int | port | Instance port. |
string | address | Instance work mode. |
Example
var url = "";
var port = 0;
var address = "";
// Gets parameters of instance
ZennoPoster.GetNewInstance(out url, out port, out address);
// Show the instance
ZennoPoster.ShowInstance(url, port, address);Example2
$url = "";
$port = 0;
$address = "";
// Gets parameters of instance
ZennoPoster::GetNewInstance($url, $port, $address);
// Show the instance
ZennoPoster::ShowInstance($url, $port, $address);HideInstance
Method
void HideInstance(string url, int port, string address)
Hide the instance
Parameters
| Type | Name | Description |
|---|---|---|
string | url | Pipe host of instance (127.0.0.1). |
int | port | Instance port. |
string | address | Instance work mode. |
Example
var url = "";
var port = 0;
var address = "";
// Gets parameters of instance
ZennoPoster.GetNewInstance(out url, out port, out address);
// Hide the instance
ZennoPoster.HideInstance(url, port, address);Example2
$url = "";
$port = 0;
$address = "";
// Gets parameters of instance
ZennoPoster::GetNewInstance($url, $port, $address);
// Hide the instance
ZennoPoster.HideInstance($url, $port, $address);ReleaseInstance
Method
void ReleaseInstance(string url, int port, string address)
Release the instance
Parameters
| Type | Name | Description |
|---|---|---|
string | url | Pipe host of instance (127.0.0.1). |
int | port | Instance port. |
string | address | Instance work mode. |
Example
// Release the instance on the known port
ZennoPoster.ReleaseInstance("127.0.0.1", port, "server");Example2
// Release the instance on the known port
ZennoPoster::ReleaseInstance("127.0.0.1", $port, "server");CaptchaSpecialRecognition
Method
string CaptchaSpecialRecognition(string dllName, Instance instance, bool asyncRecognize)
Recognizes the special captcha through the specified DLL library.
Parameters
| Type | Name | Description |
|---|---|---|
string | dllName | The path to DLL library. |
Instance | instance | The instance with captcha for recognition. |
bool | asyncRecognize | true if need async way to recognize; otherwise and default, false. |
Returns: The recognition result or id of async task.
Example
public static int Execute(Instance instance)
{
instance.ClearCookie();
Tab tb = instance.MainTab;
if ((tb.IsVoid) || (tb.IsNull)) return -1;
if (tb.IsBusy) tb.WaitDownloading();
tb.Navigate("http://lessons.zennolab.com/ru/advanced");
if (tb.IsBusy) tb.WaitDownloading();
ZennoPoster.CaptchaSpecialRecognition("KeyCaptcha.dll", instance);
return 0;
}Example2
public static function Execute($instance)
{
$instance->ClearCookie();
$tb = $instance->MainTab;
if (($tb->IsVoid) || ($tb->IsNull)) return -1;
if ($tb->IsBusy) $tb->WaitDownloading();
$tb->Navigate("http://lessons.zennolab.com/ru/advanced");
if ($tb->IsBusy) $tb->WaitDownloading();
ZennoPoster::CaptchaRecognition("KeyCaptcha.dll", $instance);
return 0;
}CaptchaRecognition
Method
string CaptchaRecognition(string dllName, string captcha, string parameters, bool asyncRecognize)
Recognizes the captcha through the specified DLL library.
Parameters
| Type | Name | Description |
|---|---|---|
string | dllName | The path to DLL library. |
string | captcha | The captcha for recognition. |
string | parameters | The recognition parameters. |
bool | asyncRecognize | true if need async way to recognize; otherwise and default, false. |
Returns: The recognition result or id of async task.
Example
public static int Execute(Instance instance)
{
instance.ClearCookie();
Tab tb = instance.MainTab;
if ((tb.IsVoid) || (tb.IsNull)) return -1;
if (tb.IsBusy) tb.WaitDownloading();
tb.Navigate("http://lessons.zennolab.com/ru/advanced");
if (tb.IsBusy) tb.WaitDownloading();
HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("img", "fulltag", "img", "text", 0);
string res = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "");
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
he.SetValue(res, "Middle", false);
return 0;
}Example2
public static function Execute($instance)
{
$instance->ClearCookie();
$tb = $instance->MainTab;
if (($tb->IsVoid) || ($tb->IsNull)) return -1;
if ($tb->IsBusy) $tb->WaitDownloading();
$tb->Navigate("http://lessons.zennolab.com/ru/advanced");
if ($tb->IsBusy) $tb->WaitDownloading();
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("img", "fulltag", "img", "text", 0);
$res = ZennoPoster::CaptchaRecognition("MonkeyEnter.dll", $he->DrawToBitmap(true), "");
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("recaptcha_response_field");
$he->SetValue($res, "Middle", false);
return 0;
}CaptchaRecognition
Method
string CaptchaRecognition(string dllName, string captcha, string parameters, bool asyncRecognize, String& confidence)
Parameters
| Type | Name | Description |
|---|---|---|
string | dllName | |
string | captcha | |
string | parameters | |
bool | asyncRecognize | |
String& | confidence |
ContextRecognition
Method
string ContextRecognition(string text, string themesType, int maxThemes, int relevance)
Recognizes the themes for the specified text.
Parameters
| Type | Name | Description |
|---|---|---|
string | text | The text for recognize. |
string | themesType | The themes type. It can be general or detailed. The detailed is not support now. |
int | maxThemes | The maximum count of the themes. |
int | relevance | The minimum relevance for the themes. |
Returns: The string which contains the all suitable themes written via separator.
CaptchaRecognition
Method
string CaptchaRecognition(string dllName, String[] captchas64Str, string parameters, bool asyncRecognize)
Recognizes the captcha through the specified DLL library.
Parameters
| Type | Name | Description |
|---|---|---|
string | dllName | The path to DLL library. |
String[] | captchas64Str | An array of captures an array of strings. |
string | parameters | The recognition parameters. |
bool | asyncRecognize | true if need async way to recognize; otherwise and default, false. |
Returns: The recognition result or id of async task.
WaitCaptchaRecognition
Method
string WaitCaptchaRecognition(string id)
Wait the reconition task with specified id.
Parameters
| Type | Name | Description |
|---|---|---|
string | id | The id of async revognition task. |
Returns: The recognition result.
Example
public static int Execute(Instance instance)
{
instance.ClearCookie();
Tab tb = instance.MainTab;
if ((tb.IsVoid) || (tb.IsNull)) return -1;
if (tb.IsBusy) tb.WaitDownloading();
tb.Navigate("http://lessons.zennolab.com/ru/advanced");
if (tb.IsBusy) tb.WaitDownloading();
HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("img", "fulltag", "img", "text", 0);
string id = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "", true);
// some more action
string res = ZennoPoster.WaitCaptchaRecognition(id);
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
he.SetValue(res, "Middle", false);
return 0;
}Example2
public static function Execute($instance)
{
$instance->ClearCookie();
$tb = $instance->MainTab;
if (($tb->IsVoid) || ($tb->IsNull)) return -1;
if ($tb->IsBusy) $tb->WaitDownloading();
$tb->Navigate("http://lessons.zennolab.com/ru/advanced");
if ($tb->IsBusy) $tb->WaitDownloading();
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("img", "fulltag", "img", "text", 0);
$id = ZennoPoster::CaptchaRecognition("MonkeyEnter.dll", $he->DrawToBitmap(true), "", true);
// some more action
$res = ZennoPoster::WaitCaptchaRecognition($id);
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("recaptcha_response_field");
$he->SetValue($res, "Middle", false);
return 0;
}GetProxy
Method
string GetProxy(string filterName, bool canonical)
Returns the proxy with the removal.
Parameters
| Type | Name | Description |
|---|---|---|
string | filterName | The name of the filter. |
bool | canonical | true if need to get canonical format of address; otherwise and default, false. |
Returns: If “canonical” is false returns a string of the format “ip:port:isSocks”; otherwise returns a string of the format “protocol://login:password@ip:port”. Default value of “canonical” is “false”.
Example
var proxy = ZennoPoster.GetProxy("filterName");Example2
$proxy = ZennoPoster::GetProxy("filterName");GetProxyWithOutDelete
Method
string GetProxyWithOutDelete(string filterName, bool canonical)
Returns the a proxy without removing it.
Parameters
| Type | Name | Description |
|---|---|---|
string | filterName | The name of the filter. |
bool | canonical | true if need to get canonical format of address; otherwise and default, false. |
Returns: If “canonical” is false returns a string of the format “ip:port:isSocks”; otherwise returns a string of the format “protocol://login:password@ip:port”. Default value of “canonical” is “false”.
Example
var proxy = ZennoPoster.GetProxyWithOutDelete("filterName");Example2
$proxy = ZennoPoster::GetProxyWithOutDelete("filterName");MailConfirm
Method
string MailConfirm(string timeoutSec, string login, string pass, string server, int port, bool useSSL, bool useHTML, bool useIMAP, bool removeMessages, string identityRegExp, string parserRegExp, int machNum, bool throwsException, String[] imapFolderNames, string proxyString, int messageCountForLoad)
Returns the text the resulting after handling mail.
Parameters
| Type | Name | Description |
|---|---|---|
string | timeoutSec | Timeout specified in seconds. Three in a row above the number recorded by ”;“. |
string | login | The login for mail. |
string | pass | The password for mail. |
string | server | The mail server. |
int | port | The server port. |
bool | useSSL | true if use SSL; otherwise, false. |
bool | useHTML | true if parse HTML; otherwise, false. |
bool | useIMAP | true if use IMAP; otherwise, false. |
bool | removeMessages | true if remove messages; otherwise, false. |
string | identityRegExp | The regular expression to identify email. |
string | parserRegExp | The regular expression for select the contents of email. |
int | machNum | Number of match. |
bool | throwsException | true if need to throw exceptions; otherwise and default, false. Standart types of exeption contains in CommandCenter.Exceptions.Mail namespace. |
String[] | imapFolderNames | An array of names of imap folders. |
string | proxyString | Proxy string in format: login:pass@ip:port OR ip:port. |
int | messageCountForLoad | Maximum number of messages for loading from every selected folder for every time. |
Returns: The result of processing emails.
Example
try
{
var res = ZennoPoster.MailConfirm("15;30;60", {email}, {password}, {server}, {port}, true, true, true, false, {identityRexExp}, {parseRegExp}, 0, true);
}
catch(CommandCenter.Exceptions.Mail.ConnectionException ex)
{
// do something when connection to server failed
}
catch(CommandCenter.Exceptions.Mail.InvalidEmailCredentialException ex)
{
// do something when login/password was wrong
}
catch(CommandCenter.Exceptions.Mail.EmailNotFoundException ex)
{
// do something when email has not been found
}
catch(Exception ex)
{
// other exceptions
}Example2
$res = ZennoPoster::MailConfirm("15;30;60", {email}, {password}, {server}, {port}, true, true, true, false, {identityRexExp}, {parseRegExp}, 0);ValidateEmail
Method
void ValidateEmail(string login, string pass, string proxyString)
Validate Email address using login and password.
Parameters
| Type | Name | Description |
|---|---|---|
string | login | The login for mail. |
string | pass | The password for mail. |
string | proxyString | Proxy string in format: login:pass@ip:port OR ip:port. |
Example
try
{
ZennoPoster.ValidateEmail({email}, {password});
}
catch
{
// Email not valid!
}Example2
try
{
$res = ZennoPoster::ValidateEmail({email}, {password});
}
catch(Exception $e)
{
// email not valid
}ValidateEmail
Method
void ValidateEmail(string login, string pass, string server, int port, bool useSSL, bool useIMAP, string proxyString)
Validate Email address using extended parameters.
Parameters
| Type | Name | Description |
|---|---|---|
string | login | The login for mail. |
string | pass | The password for mail. |
string | server | The mail server. |
int | port | The server port. |
bool | useSSL | true if use SSL; otherwise, false. |
bool | useIMAP | true if use IMAP; otherwise, false. |
string | proxyString | Proxy string in format: login:pass@ip:port OR ip:port. |
Example
try
{
ZennoPoster.ValidateEmail({email}, {password}, {server}, {port}, true, true);
}
catch
{
// Email not valid!
}Example2
try
{
$res = ZennoPoster::ValidateEmail({email}, {password}, {server}, {port}, true, true);
}
catch(Exception $e)
{
// email not valid
}BulkMailDownload
Method
Tuple`4[] BulkMailDownload(string login, string pass, string server, int port, bool useSSL, EmailProtocol protocol, int lastHours, int maxCount, bool deleteMessages, string proxyString, bool throwException)
Downloads the messages from the specified account.
Parameters
| Type | Name | Description |
|---|---|---|
string | login | The login for mail (usualy your email address). |
string | pass | The password for mail. |
string | server | The mail server. Default value is blank, ZennoPoster will try to determine your the settings. |
int | port | The server port. Default value is 143 |
bool | useSSL | true if use SSL; otherwise, false. Default value is true |
EmailProtocol | protocol | IMAP or POP3. Default value is IMAP. |
int | lastHours | If message older than specified amount of hours will not be returned. Default value is 2 hours |
int | maxCount | Max count of messages. Default value is 100. |
bool | deleteMessages | true if remove messages; otherwise, false. Default value is false. |
string | proxyString | Proxy string in format: login:pass@ip:port OR ip:port. |
bool | throwException | true if have to throw the error exception; otherwise, false. The default value is false. |
Returns: tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message with headers, tuple.Item4 - text message with headers
Example
// download all messages from gmail via IMAP
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("micosesus1979@gmail.com",
"ххххххх", "imap.gmail.com", 993, true,
ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.IMAP,
24*100, 20, false);
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
// TODO Something useful with messages
// tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
}Example2
// download all messages from gmail with auto settings detection for last 100 days.
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("superuser@gmail.com", "хххххххххх", lastHours: 24*100);
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
// TODO Something useful with messages
// tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
}Example3
// download all messages from yandex via POP3 and add results to the table
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("superuser@yandex.ru",
"ххххххххххх", "pop.yandex.ru", 995, true,
ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3,
24*100, 20, false);
// loop fo all messages
foreach(Tuple<string, string, string, string> tuple in allMails)
{
// adding messages to the table called Tabl1
// tuple.Item1 - sibject, tuple.Item2 - from, tuple.Item3 - html message, tuple.Item4 - text message
List<string> tmp = new List<string>();
tmp.Add(tuple.Item1);
tmp.Add(tuple.Item2);
tmp.Add(tuple.Item3);
tmp.Add(tuple.Item4);
project.Tables["Tabl1"].AddRow(tmp);
}FtpDownload
Method
void FtpDownload(string host, int port, string protocol, string login, string pass, string proxy, string name, string localPath)
Download the file
Parameters
| Type | Name | Description |
|---|---|---|
string | host | Address of the FTP server. |
int | port | Port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | Login of the FTP server |
string | pass | Password of the FTP server |
string | proxy | Proxy string in format: login:pass@ip:port OR ip:port |
string | name | File name. |
string | localPath | Destination path. |
Example
var list = new System.Collections.Generic.List<string>(ZennoPoster.FtpGetList({host}, {port}, {login}, {password}, {proxy}, "", false, false));
foreach(var item in list)
ZennoPoster.FtpDownload({host}, {port}, {protocol}, {login}, {password}, {proxy}, item, {directoryToSavePath});Example2
$list = new System::Collections::Generic::List<string>(ZennoPoster::FtpGetList({host}, {port}, {login}, {password}, {proxy}, "", false, false));
foreach($item as $list)
ZennoLab\CommandCenter\ZennoPoster::FtpDownload({host}, {port}, {protocol}, {login}, {password}, {proxy}, $item, {directoryToSavePath});FtpUploadFile
Method
void FtpUploadFile(string host, int port, string protocol, string login, string pass, string proxy, string serverPath, string localPath)
Uploads the specified file.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | serverPath | The destination path. |
string | localPath | The path to the file. |
Example
ZennoPoster.FtpUploadFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryToUploadPath}, {filePath});Example2
ZennoLab\CommandCenter\ZennoPoster::FtpUploadFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryToUploadPath}, {filePath});FtpUploadDirectory
Method
void FtpUploadDirectory(string host, int port, string protocol, string login, string pass, string proxy, string serverPath, string localPath, bool recursive, bool uncludeRootName)
Uploads the specified directory.
This method uploads directory and overwrite all exit items.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | serverPath | The destination path. |
string | localPath | The path to the file. |
bool | recursive | The true for uploading all subdirectories, and files in localPath; otherwise, false. |
bool | uncludeRootName | The true for include root directory name; otherwise, false. |
Example
// upload all items from local directory to the directory with same name on ftp server
ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
// upload all items from local directory to the with path "ftp_path"
ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);Example2
// upload all items from local directory to the directory with same name on ftp server
ZennoLab\CommandCenter\ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
// upload all items from local directory to the with path "ftp_path"
ZennoLab\CommandCenter\ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);FtpDeleteFile
Method
void FtpDeleteFile(string host, int port, string protocol, string login, string pass, string proxy, string name)
Delete the file.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | name | The file name. |
Example
ZennoPoster.FtpDeleteFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {filePath});Example2
ZennoLab\CommandCenter\ZennoPoster::FtpDeleteFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {filePath});FtpDeleteDirectory
Method
void FtpDeleteDirectory(string host, int port, string protocol, string login, string pass, string proxy, string name)
Delete the directory.
This method delete the directory even if specified directory contains others directories or files.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | name | The directory name. |
Example
ZennoPoster.FtpDeleteDirectory({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryName});Example2
ZennoLab\CommandCenter\ZennoPoster::FtpDeleteDirectory({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryName});FtpCreateDirectory
Method
void FtpCreateDirectory(string host, int port, string protocol, string login, string pass, string proxy, string name)
Create a directory with the specified name.
The parameter “name” can be directory name (for example: Folder) or directory path (for example: Folder\SubFolder). There are two ways specify the directory path. See example.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | name | The directory name. |
Example
// create a new directory with name "newDirectory" on "host_name"
ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "newDirectory");
// create a new directory with name "NewDirectory\newDirectory" on "host_name"
ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory\\newDirectory");
// or this way
ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory/newDirectory");Example2
// create a new directory with name "newDirectory" on "host_name"
ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "newDirectory");
// create a new directory with name "NewDirectory\newDirectory" on "host_name"
ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory\\newDirectory");
// or this way
ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory/newDirectory");FtpChmode
Method
void FtpChmode(string host, int port, string protocol, string login, string pass, string proxy, string serverPath, string mode)
Changes the access mode of specified ftp item.
For changing mode on ftp server you should make sure that current server support the “SITE CHMOD” command otherwise, this operation can not be performed. The specified item can be file or directory. In case if specified item is the directory, the mode will be changed only for this ftp item, all internal files and subdirectories will not change the mode.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | serverPath | The path of ftp item. |
string | mode | The mode for specified item. This a string value can be empty, in this case the mode of item will be “000”. |
Example
// change mode for file located on path MyFolder\MyTXTFile.txt
ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MyTXTFile.txt", "774");
// change mode for directory located on path MyFolder\MySubFolder
ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MySubFolder", "755");Example2
// change mode for file located on path MyFolder\MyTXTFile.txt
ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MyTXTFile.txt", "774");
// change mode for directory located on path MyFolder\MySubFolder
ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MySubFolder", "755");FtpGetList
Method
IEnumerable<string> FtpGetList(string host, int port, string protocol, string login, string pass, string proxy, string directoryName, bool recursive, bool includeDirectory)
Returns all files in the directory.
Parameters
| Type | Name | Description |
|---|---|---|
string | host | The address of the FTP server. |
int | port | The port of the FTP server. |
string | protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
string | login | The login of the FTP server. |
string | pass | The password of the FTP server. |
string | proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
string | directoryName | The directory name. |
bool | recursive | The true if use recursion; otherwise, false. |
bool | includeDirectory | The true if use subdirectories; otherwise, false. |
Returns: The list of all files and directories represented by collection of the IEnumerable interface.
Example
var list = new System.Collections.Generic.List<string>(ZennoPoster.FtpGetList({host}, {port}, {protocol}, {login}, {password}, {proxy}, "", false, false));Example2
$list = new System::Collections::Generic::List<string>(ZennoLab\CommandCenter\ZennoPoster::FtpGetList({host}, {port}, {protocol}, {login}, {password}, {proxy}, "", false, false));ImageProcessingUntreatedFromScreenshot
Method
void ImageProcessingUntreatedFromScreenshot(int instancePort, string path, int quality, string exif)
Untreated image from screenshot.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | path | The save file path. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// image without processing
ZennoPoster.ImageProcessingUntreatedFromScreenshot(instance.Port, "C:\\ResultImage.jpeg");Example2
// image without processing
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingUntreatedFromScreenshot($instance->Port, "C:\\ResultImage.jpeg");ImageProcessingUntreatedFromUrl
Method
void ImageProcessingUntreatedFromUrl(string url, string savePath, int quality, string exif)
Untreated image from url.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// image without processing
ZennoPoster.ImageProcessingUntreatedFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg");Example2
// image without processing
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingUntreatedFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg");ImageProcessingUntreatedFromFile
Method
void ImageProcessingUntreatedFromFile(string filePath, string savePath, int quality, string exif)
Untreated image from file.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// image without processing
ZennoPoster.ImageProcessingUntreatedFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg");Example2
// image without processing
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingUntreatedFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg");ImageProcessingResizeFromScreenshot
Method
void ImageProcessingResizeFromScreenshot(int instancePort, string savePath, int width, int height, string units, bool keep, bool notIncImage, int quality, string exif)
Performs resizing of the image from screenshot.
The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
int | width | A new width of the image. |
int | height | A new height of the image. |
string | units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
bool | keep | If need to keep the aspect ratio then “true”; otherwise “false”. |
bool | notIncImage | If not increase size of the image then “true”; otherwise “false”. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// resize image from screenshot, the width and height in pixel
ZennoPoster.ImageProcessingResizeFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
// resize image from screenshot, the width and height in percentage
ZennoPoster.ImageProcessingResizeFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);Example2
// resize image from screenshot, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
// resize image from screenshot, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);ImageProcessingResizeFromUrl
Method
void ImageProcessingResizeFromUrl(string url, string savePath, int width, int height, string units, bool keep, bool notIncImage, int quality, string exif)
Performs resizing of the image from url.
The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
int | width | A new width of the image. |
int | height | A new height of the image. |
string | units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
bool | keep | If need to keep the aspect ratio then “true”; otherwise “false”. |
bool | notIncImage | If not increase size of the image then “true”; otherwise “false”. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// resize image from url, the width and height in pixel
ZennoPoster.ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
// resize image from url, the width and height in percentage
ZennoPoster.ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);Example2
// resize image from url, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
// resize image from url, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingResizeFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);ImageProcessingResizeFromFile
Method
void ImageProcessingResizeFromFile(string filePath, string savePath, int width, int height, string units, bool keep, bool notIncImage, int quality, string exif)
Performs resizing of the image from file.
The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
int | width | A new width of the image. |
int | height | A new height of the image. |
string | units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
bool | keep | If need to keep the aspect ratio then “true”; otherwise “false”. |
bool | notIncImage | If not increase size of the image then “true”; otherwise “false”. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// resize image from file, the width and height in pixel
ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
// resize image from file, the width and height in percentage
ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);Example2
// resize image from file, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 100, 120, "pixel", true, false);
// resize image from file, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster.ImageProcessingResizeFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 200, 200, "percent", true, false);ImageProcessingCropFromScreenshot
Method
void ImageProcessingCropFromScreenshot(int instancePort, string savePath, int leftBorder, int topBorder, int cropWidth, int cropHeight, string units, int quality, string exif)
Performs cropping of the image from screenshot.
The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
int | leftBorder | The indent from left border of the image. |
int | topBorder | The indent from top border of the image. |
int | cropWidth | The width for cropping. |
int | cropHeight | The height for cropping. |
string | units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// cropping image from screenshot, the width and height in pixel
ZennoPoster.ImageProcessingCropFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
// cropping image from screenshot, the width and height in percentage
ZennoPoster.ImageProcessingCropFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");Example2
// cropping image from screenshot, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
// cropping image from screenshot, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromScreenshot(#instance->Port, "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");ImageProcessingCropFromUrl
Method
void ImageProcessingCropFromUrl(string url, string savePath, int leftBorder, int topBorder, int cropWidth, int cropHeight, string units, int quality, string exif)
Performs cropping of the image from url.
The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
int | leftBorder | The indent from left border of the image. |
int | topBorder | The indent from top border of the image. |
int | cropWidth | The width for cropping. |
int | cropHeight | The height for cropping. |
string | units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// cropping image from url, the width and height in pixel
ZennoPoster.ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
// cropping image from url, the width and height in percentage
ZennoPoster.ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");Example2
// cropping image from url, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
// cropping image from url, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "percent");ImageProcessingCropFromFile
Method
void ImageProcessingCropFromFile(string filePath, string savePath, int leftBorder, int topBorder, int cropWidth, int cropHeight, string units, int quality, string exif)
Performs cropping of the image from file.
The default value of the units parameter is “pixel”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
int | leftBorder | The indent from left border of the image. |
int | topBorder | The indent from top border of the image. |
int | cropWidth | The width for cropping. |
int | cropHeight | The height for cropping. |
string | units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// cropping image from file, the width and height in pixel
ZennoPoster.ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
// cropping image from file, the width and height in percentage
ZennoPoster.ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 75, 75, "percent");Example2
// cropping image from file, the width and height in pixel
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 150, 250, "pixel");
// cropping image from file, the width and height in percentage
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingCropFromFile("C:\\ImageForCrop.jpeg", "C:\\ResultImage.jpeg", 10, 10, 75, 75, "percent");ImageProcessingRotateFromScreenshot
Method
void ImageProcessingRotateFromScreenshot(int instancePort, string savePath, int angle, int quality, string exif)
Performs rotation of the image from screenshot.
The angle is specified in degrees. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
int | angle | An angle of the rotation. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// the rotation of image at 45 degrees
ZennoPoster.ImageProcessingRotateFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 45);Example2
// the rotation of image at 45 degrees
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingRotateFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", 45);ImageProcessingRotateFromUrl
Method
void ImageProcessingRotateFromUrl(string url, string savePath, int angle, int quality, string exif)
Performs rotation of the image from url.
The angle is specified in degrees. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
int | angle | An angle of the rotation. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// the rotation of image at 45 degrees
ZennoPoster.ImageProcessingRotateFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 45);Example2
// the rotation of image at 45 degrees
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingRotateFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 45);ImageProcessingRotateFromFile
Method
void ImageProcessingRotateFromFile(string filePath, string savePath, int angle, int quality, string exif)
Performs rotation of the image from file.
The angle is specified in degrees. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
int | angle | An angle of the rotation. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// the rotation of image at 45 degrees
ZennoPoster.ImageProcessingRotateFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 45);Example2
// the rotation of image at 45 degrees
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingRotateFromFile("C:\\ImageForResize.jpeg", "C:\\ResultImage.jpeg", 45);ImageProcessingWaterMarkTextFromScreenshot
Method
void ImageProcessingWaterMarkTextFromScreenshot(int instancePort, string savePath, string imposition, string location, string text, int transparency, string style, int offsetLeft, int offsetTop, int quality, string exif)
Adds the water mark fom text to image from screenshot.
The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
string | imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
string | location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
string | text | The text of the water mark. |
int | transparency | The transparency of the water mark. The value from 0 to 100. |
string | style | The string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue] |
int | offsetLeft | The offset from left. Default value is 0. |
int | offsetTop | The offset from top. Default value is 0. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// add water mark text to image from sceenshot
ZennoPoster.ImageProcessingWaterMarkTextFromFile(instance.Port, "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);Example2
// add water mark text to image from sceenshot
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkTextFromFile($instance->Port, "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);ImageProcessingWaterMarkTextFromUrl
Method
void ImageProcessingWaterMarkTextFromUrl(string url, string savePath, string imposition, string location, string text, int transparency, string style, int offsetLeft, int offsetTop, int quality, string exif)
Adds the water mark fom text to image from url.
The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
string | imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
string | location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
string | text | The text of the water mark. |
int | transparency | The transparency of the water mark. The value from 0 to 100. |
string | style | The string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue] |
int | offsetLeft | The offset from left. Default value is 0. |
int | offsetTop | The offset from top. Default value is 0. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// add water mark text to image from url
ZennoPoster.ImageProcessingWaterMarkTextFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);Example2
// add water mark text to image from url
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkTextFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);ImageProcessingWaterMarkTextFromFile
Method
void ImageProcessingWaterMarkTextFromFile(string filePath, string savePath, string imposition, string location, string text, int transparency, string style, int offsetLeft, int offsetTop, int quality, string exif)
Adds the water mark fom text to image from file.
The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
string | imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
string | location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
string | text | The text of the water mark. |
int | transparency | The transparency of the water mark. The value from 0 to 100. |
string | style | The string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue] |
int | offsetLeft | The offset from left. Default value is 0. |
int | offsetTop | The offset from top. Default value is 0. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// add water mark text to image from file
ZennoPoster.ImageProcessingWaterMarkTextFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);Example2
// add water mark text to image from file
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkTextFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "water mark text", 50, "Tahoma, 24pt, Bold, Italic, Underline, [255;0;0;0]", 10, 10);ImageProcessingWaterMarkImageFromScreenshot
Method
void ImageProcessingWaterMarkImageFromScreenshot(int instancePort, string savePath, string imposition, string location, string path, int transparency, int offsetLeft, int offsetTop, int quality, string exif)
Adds the water mark from image to image from screenshot.
The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
string | imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
string | location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
string | path | The file path of the image which will be a water mark. |
int | transparency | The transparency of the water mark. The value from 0 to 100. |
int | offsetLeft | The offset from left. Default value is 0. |
int | offsetTop | The offset from top. Default value is 0. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// add water mark to image from screenshot
ZennoPoster.ImageProcessingWaterMarkImageFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);Example2
// add water mark to image from screenshot
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkImageFromScreenshot($instance->Port, "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);ImageProcessingWaterMarkImageFromUrl
Method
void ImageProcessingWaterMarkImageFromUrl(string url, string savePath, string imposition, string location, string path, int transparency, int offsetLeft, int offsetTop, int quality, string exif)
Adds the water mark from image to image from url.
The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
string | imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
string | location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
string | path | The file path of the image which will be a water mark. |
int | transparency | The transparency of the water mark. The value from 0 to 100. |
int | offsetLeft | The offset from left. Default value is 0. |
int | offsetTop | The offset from top. Default value is 0. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// add water mark to image from url
ZennoPoster.ImageProcessingWaterMarkImageFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);Example2
// add water mark to image from url
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkImageFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);ImageProcessingWaterMarkImageFromFile
Method
void ImageProcessingWaterMarkImageFromFile(string filePath, string savePath, string imposition, string location, string path, int transparency, int offsetLeft, int offsetTop, int quality, string exif)
Adds the water mark from image to image from file.
The default value of the imposition parameter is “horizontally”. The default value of the location is “center”. If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
string | imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
string | location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
string | path | The file path of the image which will be a water mark. |
int | transparency | The transparency of the water mark. The value from 0 to 100. |
int | offsetLeft | The offset from left. Default value is 0. |
int | offsetTop | The offset from top. Default value is 0. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// add water mark to image from file
ZennoPoster.ImageProcessingWaterMarkImageFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);Example2
// add water mark to image from file
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingWaterMarkImageFromFile("C:\\ImageForWaterMark.jpeg", "C:\\ResultImage.jpeg", "horizontally", "center", "C:\\WaterMarkImage.jpeg", 50, 10, 10);ImageProcessingMirrorFromScreenshot
Method
void ImageProcessingMirrorFromScreenshot(int instancePort, string savePath, string mirror, int quality, string exif)
Performs the mirror reflection of the image from screenshot.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
string | mirror | The type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// performs the horizontal mirror reflection of screenshot and save it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Horizontal");
// performs the vertical mirror reflection of screenshot and save it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Vertical");
// performs the horizontal and vertical mirror reflection of screenshot and save it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "HorizontalVertical");Example2
// performs the horizontal mirror reflection of screenshot and save it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Horizontal");
// performs the vertical mirror reflection of screenshot and save it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "Vertical");
// performs the horizontal and vertical mirror reflection of screenshot and save it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromScreenshot(instance.Port, "C:\\newImage.jpg", "HorizontalVertical");ImageProcessingMirrorFromUrl
Method
void ImageProcessingMirrorFromUrl(string url, string savePath, string mirror, int quality, string exif)
Performs the mirror reflection of the image from url.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
string | mirror | The type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// performs the horizontal mirror reflection of image from url and save it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Horizontal");
// performs the vertical mirror reflection of image from url and save it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Vertical");
// performs the horizontal and vertical mirror reflection of image from url and save it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "HorizontalVertical");Example2
// performs the horizontal mirror reflection of image from url and save it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Horizontal");
// performs the vertical mirror reflection of image from url and save it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "Vertical");
// performs the horizontal and vertical mirror reflection of image from url and save it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromUrl("someurl.com/image.php", "C:\\newImage.jpg", "HorizontalVertical");ImageProcessingMirrorFromFile
Method
void ImageProcessingMirrorFromFile(string filePath, string savePath, string mirror, int quality, string exif)
Performs the mirror reflection of image from file.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
string | mirror | The type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
string | exif | The Exif Tags for metadata of image. Default value is empty string. Each tag must be written from a new line. The format of data is follow: {TagName} |
Example
// performs the horizontal mirror reflection of oldImage.jpg and saves it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Horizontal");
// performs the vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Vertical");
// performs the horizontal and vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
ZennoPoster.ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "HorizontalVertical");Example2
// performs the horizontal mirror reflection of oldImage.jpg and saves it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Horizontal");
// performs the vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "Vertical");
// performs the horizontal and vertical mirror reflection of oldImage.jpg and saves it to newImage.jpg
ZennoLab\CommandCenter\ZennoPoster::ImageProcessingMirrorFromFile("C:\\oldImage.jpg", "C:\\newImage.jpg", "HorizontalVertical");ImageProcessingClearExifFromScreenshot
Method
void ImageProcessingClearExifFromScreenshot(int instancePort, string savePath, int quality)
Performs clearing all EXIF tags in metadata of image loaded from screenshot.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
int | instancePort | The port of the instance. |
string | savePath | The save file path. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
Example
// clear exif for image from screenshot
ZennoPoster.ImageProcessingClearExifFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100);Example2
// clear exif for image from screenshot
ZennoPoster::ImageProcessingClearExifFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100);ImageProcessingClearExifFromUrl
Method
void ImageProcessingClearExifFromUrl(string url, string savePath, int quality)
Performs clearing all EXIF tags in metadata of image loaded from url.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | url | The url of the image. |
string | savePath | The save file path. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
Example
// clear exif for image from url
ZennoPoster.ImageProcessingClearExifFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100);Example2
// clear exif for image from url
ZennoPoster::ImageProcessingClearExifFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100);ImageProcessingClearExifFromFile
Method
void ImageProcessingClearExifFromFile(string filePath, string savePath, int quality)
Performs clearing all EXIF tags in metadata of image loaded from file.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Type | Name | Description |
|---|---|---|
string | filePath | The file path of the image for processing. |
string | savePath | The save file path. |
int | quality | The image quality. The value from 0 to 100. Default value is 100. |
Example
// clear exif for image from file
ZennoPoster.ImageProcessingClearExifFromFile("C:\\ImageForClear.jpeg", "C:\\ResultImage.jpeg", 100);Example2
// clear exif for image from file
ZennoPoster::ImageProcessingClearExifFromFile("C:\\ImageForClear.jpeg", "C:\\ResultImage.jpeg", 100);AddTask
Method
void AddTask(string task)
Add a new task.
Parameters
| Type | Name | Description |
|---|---|---|
string | task | The new task to add in xml format. |
Example
// Create a task in xml format
var task =
@"<Id>{guid}</Id>
<Name>{name}</Name>
<CreateTime>{date DD.MM.YYYY hh:mm:ss}</CreateTime>
<ExecutionSettings>
<LimitOfThreads>1</LimitOfThreads>
<MaxAllowOfThreads>0</MaxAllowOfThreads>
<DoneSuccessfully>0</DoneSuccessfully>
<DoneAll>0</DoneAll>
<NumberOfTries>0</NumberOfTries>
<LastNumberOfTries>0</LastNumberOfTries>
<Priority>50</Priority>
<Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
<Status>Newbie</Status>
<ProxyLabels></ProxyLabels>
<ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
<GroupLabels>Без метки</GroupLabels>
<GroupStates>Выполнены</GroupStates>
<MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
<MaxNumOfFailStop>-1</MaxNumOfFailStop>
<NumOfFailStop>0</NumOfFailStop>
</ExecutionSettings>
<Scheduler7Settings>
<IsActive>{True, False}</IsActive>
<ExecutePeriod>{OneTime, EveryDay, EveryWeek, EveryMonth, OnDemand}</ExecutePeriod>
<DaysOfWeek>{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}</DaysOfWeek>
<DaysOfMonth>1-5,10,20</DaysOfMonth>
<FileName>C:\Program Files\ZennoLab\signalFile.txt</FileName><IsNeedDeleteFile>{True, False}</IsNeedDeleteFile>
<StartDateType>{Immediately, OnDate}</StartDateType>
<StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
<AttemptsRange>{5, 5 -10}</AttemptsRange> <IsClearSuccess>{True, False}</IsClearSuccess>
<Intervals>{09:00,12:00 - 17:00}</Intervals>
<RepeatType>{Continued, ContinuedWithPause, Regularly, Count}</RepeatType>
<RepeatCountDayRange>{1, 5 -10}</RepeatCountDayRange>
<EndDateType>{Infinity, OnDate, Count}</EndDateType>
<RepeatCountTotalRange>{50, 75-100}</RepeatCountTotalRange>
<EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>
</Scheduler7Settings>
<Project>
<ProjectFileLocation>{path}</ProjectFileLocation>
<ProjectType>Assembly</ProjectType>
</Project>";
// Add the task
ZennoPoster.AddTask(task);RemoveTask
Method
void RemoveTask(Guid id)
Remove the task
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to remove. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, remove the task
ZennoPoster.RemoveTask(id);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, remove the task
ZennoPoster::RemoveTask($id);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}GetTaskInfo
Method
string GetTaskInfo(Guid id)
Get the information of task
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to start. |
Returns: Task information in xml format.
Example
// Gets information of task from the known task's id
var task = ZennoPoster.GetTaskInfo(id);Example2
// Gets information of task from the known task's id
$task = ZennoPoster::GetTaskInfo($id);GetTaskInfo
Method
string GetTaskInfo(string projectPath)
Get the information of task
Parameters
| Type | Name | Description |
|---|---|---|
string | projectPath | Path to project of task |
Returns: Task information in xml format.
Example
// Gets information of task from the known task's project path
var task = ZennoPoster.GetTaskInfo(path);Example2
// Gets information of task from the known task's project path
$task = ZennoPoster::GetTaskInfo($path);StopTask
Method
void StopTask(Guid id)
Stop the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to stop. |
Example2
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, stop the task
ZennoPoster.StopTask(id);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, stop the task
ZennoPoster::StopTask($id);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}StopTask
Method
void StopTask(string name)
Stop the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task to stop. Finds the first occurrence. |
Example2
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, stop first task with this name
ZennoPoster.StopTask(name);
else
throw new FormatException("Name is empty");
}Example
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, stop first task with this name
ZennoPoster::StopTask($name);
else
throw new FormatException("Name is empty");
}InterruptTask
Method
void InterruptTask(Guid id)
Interrupt the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to interrupt. |
Example2
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, interrupt the task
ZennoPoster.InterruptTask(id);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, interrupt the task
ZennoPoster::InterruptTask($id);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}InterruptTask
Method
void InterruptTask(string name)
Interrupt the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task to interrupt. Finds the first occurrence. |
Example2
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, interrupt first task with this name
ZennoPoster.InterruptTask(name);
else
throw new FormatException("Name is empty");
}Example
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, interrupt first task with this name
ZennoPoster::InterruptTask($name);
else
throw new FormatException("Name is empty");
}StartTask
Method
void StartTask(Guid id)
Start the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to start. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, start the task
ZennoPoster.StartTask(id);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, start the task
ZennoPoster::StartTask($id);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}StartTask
Method
void StartTask(string name)
Start the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task to start. Finds the first occurrence. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, start first task with this name
ZennoPoster.StartTask(name);
else
throw new FormatException("Name is empty");
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, start first task with this name
ZennoPoster::StartTask($name);
else
throw new FormatException("Name is empty");
}AddTries
Method
void AddTries(Guid id, int count)
Adds tries to the task
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task. |
int | count | Count of tries to add. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, start the task
ZennoPoster.AddTries(id, 30);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, start the task
ZennoPoster::AddTries($id, 30);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}AddTries
Method
void AddTries(string name, int count)
Adds tries to the task
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task. Finds the first occurrence. |
int | count | Count of tries to add. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, adds tries to first task with this name
ZennoPoster.AddTries(name, 30);
else
throw new FormatException("Name is empty");
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, adds tries to first task with this name
ZennoPoster::AddTries($name, 30);
else
throw new FormatException("Name is empty");
}SetTries
Method
void SetTries(Guid id, int count)
Sets tries to the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task. |
int | count | Count of tries to set. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, start the task
ZennoPoster.SetTries(id, 50);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, start the task
ZennoPoster::SetTries($id, 50);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}SetMaxThreads
Method
void SetMaxThreads(Guid id, int count)
Sets max threads to the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task. |
int | count | Count of tries to set. |
SetTries
Method
void SetTries(string name, int count)
Sets tries to the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task. Finds the first occurrence. |
int | count | Count of tries to set. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, sets tries to first task with this name
ZennoPoster.SetTries(name, 50);
else
throw new FormatException("Name is empty");
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, sets tries to first task with this name
ZennoPoster::SetTries($name, 50);
else
throw new FormatException("Name is empty");
}SetMaxThreads
Method
void SetMaxThreads(string name, int count)
Sets max threads to the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task. Finds the first occurrence. |
int | count | Count of tries to set. |
ClearSuccess
Method
void ClearSuccess(Guid id)
Clear success of the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, clear success of the task
ZennoPoster.ClearSuccess(id);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, clear success of the task
ZennoPoster::ClearSuccess($id);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}ClearFails
Method
void ClearFails(Guid id)
Clear fails of the task by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task id
var xpath = "Task/Id";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string result;
var node = doc.SelectSingleNode(xpath);
if (node != null)
result = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
Guid id;
// Parse guid
if (Guid.TryParse(result, out id))
// If ok, clear fails of the task
ZennoPoster.ClearFails(id);
else
throw new FormatException(string.Format("{0} is not guid", result));
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task id
$xpath = "Task/Id";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$result;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$result = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
$id = "";
// Parse guid
if (Guid::TryParse($result, $id))
// If ok, clear fails of the task
ZennoPoster::ClearFails($id);
else
throw new FormatException(String::Format("{0} is not guid", $result));
}ClearSuccess
Method
void ClearSuccess(string name)
Clear success of the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task. Finds the first occurrence. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, clears success for first task with this name
ZennoPoster.ClearSuccess(name);
else
throw new FormatException("Name is empty");
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, clears success for first task with this name
ZennoPoster::ClearSuccess($name);
else
throw new FormatException("Name is empty");
}ClearFails
Method
void ClearFails(string name)
Clear fails of the task by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task. Finds the first occurrence. |
Example
// Gets list of tasks
var tasksList = new List<string>(ZennoPoster.TasksList);
// Check the presence of items in the list
if(tasksList.Count != 0)
{
// Select ane item
var source = tasksList[0];
// Sets path to task name
var xpath = "Task/Name";
// Gets guid string from task data
var doc = new System.Xml.XmlDocument();
doc.LoadXml("<Task>" + source + "</Task>");
string name;
var node = doc.SelectSingleNode(xpath);
if (node != null)
name = node.InnerXml;
else
throw new InvalidDataException(string.Format("{0} is null", xpath));
if(!String.IsNullOrEmpty(name))
// If ok, clears fails for first task with this name
ZennoPoster.ClearFails(name);
else
throw new FormatException("Name is empty");
}Example2
// Gets list of tasks
$tasksList = new List<string>(ZennoPoster::TasksList);
// Check the presence of items in the list
if(tasksList->Count != 0)
{
// Select ane item
$source = $tasksList[0];
// Sets path to task name
$xpath = "Task/Name";
// Gets guid string from task data
$doc = new System\Xml\XmlDocument();
$doc->LoadXml("<Task>" + $source + "</Task>");
$name;
$node = $doc->SelectSingleNode($xpath);
if ($node != null)
$name = $node->InnerXml;
else
throw new InvalidDataException(String::Format("{0} is null", $xpath));
if (String::IsNullOrEmpty($name))
// If ok, clears fails for first task with this name
ZennoPoster::ClearFails($name);
else
throw new FormatException("Name is empty");
}SetExecutionSettings
Method
void SetExecutionSettings(Guid id, string executionSettings)
Set the execution settings by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id task to change execution settings. |
string | executionSettings | New execution settings to change in xml format. |
Example
// Create execution settings in xml format
var settings =
@"<LimitOfThreads>1</LimitOfThreads>
<MaxAllowOfThreads>0</MaxAllowOfThreads>
<DoneSuccessfully>0</DoneSuccessfully>
<DoneAll>0</DoneAll>
<NumberOfTries>0</NumberOfTries>
<LastNumberOfTries>0</LastNumberOfTries>
<Priority>50</Priority>
<Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
<Status>Newbie</Status>
<ProxyLabels></ProxyLabels>
<ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
<GroupLabels>Без метки</GroupLabels>
<GroupStates>Выполнены</GroupStates>
<MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
<MaxNumOfFailStop>-1</MaxNumOfFailStop>
<NumOfFailStop>0</NumOfFailStop>";
// Set the settings to the task with known id
var id = Guid.Empty;
ZennoPoster.SetExecutionSettings(id, settings);Example2
// Create execution settings in xml format
$settings =
@"<LimitOfThreads>1</LimitOfThreads>
<MaxAllowOfThreads>0</MaxAllowOfThreads>
<DoneSuccessfully>0</DoneSuccessfully>
<DoneAll>0</DoneAll>
<NumberOfTries>0</NumberOfTries>
<LastNumberOfTries>0</LastNumberOfTries>
<Priority>50</Priority>
<Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
<Status>Newbie</Status>
<ProxyLabels></ProxyLabels>
<ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
<GroupLabels>Без метки</GroupLabels>
<GroupStates>Выполнены</GroupStates>
<MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
<MaxNumOfFailStop>-1</MaxNumOfFailStop>
<NumOfFailStop>0</NumOfFailStop>";
// Set the settings to the task with known id
$id = Guid::Empty;
ZennoPoster::SetExecutionSettings($id, $settings);SetExecutionSettings
Method
void SetExecutionSettings(string name, string executionSettings)
Set the execution settings by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task to change execution settings. Finds the first occurrence. |
string | executionSettings | New execution settings to change in xml format. |
Example
// Create execution settings in xml format
var settings =
@"<LimitOfThreads>1</LimitOfThreads>
<MaxAllowOfThreads>0</MaxAllowOfThreads>
<DoneSuccessfully>0</DoneSuccessfully>
<DoneAll>0</DoneAll>
<NumberOfTries>0</NumberOfTries>
<LastNumberOfTries>0</LastNumberOfTries>
<Priority>50</Priority>
<Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
<Status>Newbie</Status>
<ProxyLabels></ProxyLabels>
<ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
<GroupLabels>Без метки</GroupLabels>
<GroupStates>Выполнены</GroupStates>
<MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
<MaxNumOfFailStop>-1</MaxNumOfFailStop>
<NumOfFailStop>0</NumOfFailStop>";
// Set the settings to first task with known name
var name = "Name";
ZennoPoster.SetExecutionSettings(name, settings);Example2
// Create execution settings in xml format
$settings =
@"<LimitOfThreads>1</LimitOfThreads>
<MaxAllowOfThreads>0</MaxAllowOfThreads>
<DoneSuccessfully>0</DoneSuccessfully>
<DoneAll>0</DoneAll>
<NumberOfTries>0</NumberOfTries>
<LastNumberOfTries>0</LastNumberOfTries>
<Priority>50</Priority>
<Proxy>{DoNotUseProxy, IfPossible, UseProxyWithoutRemove, UseProxy}</Proxy>
<Status>Newbie</Status>
<ProxyLabels></ProxyLabels>
<ShouldBeExecutedRandomly>{True, False}</ShouldBeExecutedRandomly>
<GroupLabels>Без метки</GroupLabels>
<GroupStates>Выполнены</GroupStates>
<MaxNumOfSuccessStop>-1</MaxNumOfSuccessStop>
<MaxNumOfFailStop>-1</MaxNumOfFailStop>
<NumOfFailStop>0</NumOfFailStop>";
// Set the settings to first task with known name
$name = "Name";
ZennoPoster::SetExecutionSettings($name, $settings);SetSchedulerSettings
Method
void SetSchedulerSettings(Guid id, string schedulerSettings)
Set the sсheduler settings by id.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to change scheduler settings. |
string | schedulerSettings | New scheduler settings to change in xml format. |
Example
// Create scheduler setting in xml format
var settings =
@"<IsActive>{True, False}</IsActive>
<ExecutePeriod>{OneTime, EveryDay, EveryWeek, EveryMonth, OnDemand}</ExecutePeriod>
<DaysOfWeek>{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}</DaysOfWeek>
<DaysOfMonth>1-5,10,20</DaysOfMonth>
<FileName>C:\Program Files\ZennoLab\signalFile.txt</FileName><IsNeedDeleteFile>{True, False}</IsNeedDeleteFile>
<StartDateType>{Immediately, OnDate}</StartDateType>
<StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
<AttemptsRange>{5, 5 -10}</AttemptsRange> <IsClearSuccess>{True, False}</IsClearSuccess>
<Intervals>{09:00,12:00 - 17:00}</Intervals>
<RepeatType>{Continued, ContinuedWithPause, Regularly, Count}</RepeatType>
<RepeatCountDayRange>{1, 5 -10}</RepeatCountDayRange>
<EndDateType>{Infinity, OnDate, Count}</EndDateType>
<RepeatCountTotalRange>{50, 75-100}</RepeatCountTotalRange>
<EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>";
// Set the setting to the task with known id
var id = Guid.Empty;
ZennoPoster.SetSchedulerSettings(id, settings);SetSchedulerSettings
Method
void SetSchedulerSettings(string name, string schedulerSettings)
Set the sсheduler settings by name.
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of task to change scheduler settings. Finds the first occurrence. |
string | schedulerSettings | New scheduler settings to change in xml format. |
Example
// Create scheduler setting in xml format
var settings =
@"<IsActive>{True, False}</IsActive>
<ExecutePeriod>{OneTime, EveryDay, EveryWeek, EveryMonth, OnDemand}</ExecutePeriod>
<DaysOfWeek>{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday}</DaysOfWeek>
<DaysOfMonth>1-5,10,20</DaysOfMonth>
<FileName>C:\Program Files\ZennoLab\signalFile.txt</FileName><IsNeedDeleteFile>{True, False}</IsNeedDeleteFile>
<StartDateType>{Immediately, OnDate}</StartDateType>
<StartDate>{date DD.MM.YYYY hh:mm:ss}</StartDate>
<AttemptsRange>{5, 5 -10}</AttemptsRange> <IsClearSuccess>{True, False}</IsClearSuccess>
<Intervals>{09:00,12:00 - 17:00}</Intervals>
<RepeatType>{Continued, ContinuedWithPause, Regularly, Count}</RepeatType>
<RepeatCountDayRange>{1, 5 -10}</RepeatCountDayRange>
<EndDateType>{Infinity, OnDate, Count}</EndDateType>
<RepeatCountTotalRange>{50, 75-100}</RepeatCountTotalRange>
<EndDate>{date DD.MM.YYYY hh:mm:ss}</EndDate>";
// Set the setting to first task with known name
var name = "Name";
ZennoPoster.SetSchedulerSettings(name, settings);ExportInputSettings
Method
string ExportInputSettings(Guid id)
Export the input settings
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to export settings. |
Returns: Input settings in xml format.
Example
// Getting GUID of the current project
Guid id = Guid.Parse(project.TaskId);
// Export setting in xml format
string settings = ZennoPoster.ExportInputSettings(id);Example2
// Export setting in xml format
$id = System\Guid::Empty;
$settings = ZennoLab\CommandCenter\ZennoPoster::ExportInputSettings($id);ImportInputSettings
Method
void ImportInputSettings(Guid id, string source)
Export the input settings.
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of task to export settings. |
string | source | New input settings to change in xml format. |
Example
// Setting GUID of the target project
var id = Guid.Empty;
var settings = ZennoPoster.ExportInputSettings(id);
// Import setting in xml format
ZennoPoster.ImportInputSettings(id, settings);Example2
// Import setting in xml format
$id = System\Guid::Empty;
$settings = ZennoLab\CommandCenter\ZennoPoster::ExportInputSettings($id);
// Import setting in xml format
ZennoLab\CommandCenter\ZennoPoster::ImportInputSettings($id, $settings);GetThreadsCount
Method
int GetThreadsCount()
Returns count of tasks that currently running
Returns: Count of threads.
Example
int count = ZennoPoster.GetThreadsCount();GetThreadsCount
Method
int GetThreadsCount(string name)
Returns count of threads for certain tasks
Parameters
| Type | Name | Description |
|---|---|---|
string | name | Name of a task. |
Returns: Count of threads.
Example
int count = ZennoPoster.GetThreadsCount(taskName);GetThreadsCount
Method
int GetThreadsCount(Guid id)
Returns count of threads for certain tasks
Parameters
| Type | Name | Description |
|---|---|---|
Guid | id | Id of a task. |
Returns: Count of threads.
Example
int count = ZennoPoster.GetThreadsCount(taskName);