ZennoPoster
Assembly: ZennoLab.CommandCenter
Full name: ZennoLab.CommandCenter.ZennoPoster
Represents a set methods to recognize captcha, working with mail, instances, etc.
Properties
RealInstanceManagerService
Property
Service for internal use only
RealTaskManagerService
Property
Service for internal use only
AllInstances
Property
Gets array of all instances ports.
TasksList
Property
Gets the collection of tasks
Example
// Gets list of tasks
var tasksList = ZennoPoster.TasksList;Example2
// Gets list of tasks
$tasksList = ZennoPoster::TasksList;Methods
ConnectToTaskManagerService
Method
Подключиться к wcf сервису для работы с заданиями
Parameters
| Параметр | Описание |
|---|---|
service | сервис |
ConnectToInstanceManagerService
Method
Подключиться к wcf сервису для работы с инстансами
Parameters
| Параметр | Описание |
|---|---|
service | сервис |
getProcesses | брать процессы или нет |
CloseConnectionWithInstanceManager
Method
Отключиться от wcf сервиса для работы с инстансами
Parameters
| Параметр | Описание |
|---|---|
service | |
shouldClose |
CloseConnectionWithTaskManager
Method
Отключиться от wcf сервиса для работы с заданиями
Parameters
| Параметр | Описание |
|---|---|
service | пайп |
shouldClose | закрывать сервис или нет |
HttpGet
Method
Executes get request
Parameters
| Параметр | Описание |
|---|---|
url | Target address of request. |
proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
Encoding | Encoding format. |
respType | Response type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File). |
Timeout | Timeout in milliseconds of request. |
Cookies | Cookies for request. |
UserAgent | UserAgent for request. |
UseRedirect | true if use redirect; otherwise, false. |
MaxRedirectCount | Maximum count of redirects. |
AdditionalHeaders | An array of captures an array of additional headers. |
DownloadPath | Download path for file. |
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);HttpGetBytes
Method
Executes get request
Parameters
| Параметр | Описание |
|---|---|
url | Target address of request. |
proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
Encoding | Encoding format. |
Timeout | Timeout in milliseconds of request. |
Cookies | Cookies for request. |
UserAgent | UserAgent for request. |
UseRedirect | true if use redirect; otherwise, false. |
MaxRedirectCount | Maximum count of redirects. |
AdditionalHeaders | An array of captures an array of additional headers. |
UseOriginalUrl | true if use original url; otherwise, false. |
Returns: The result byte array of request.
Example
var resultHttpGetBytes = ZennoPoster.HttpGet("https://www.google.ru/", "", "UTF-8");Example2
$resultHttpGetBytes = ZennoPoster::HttpGet("https://www.google.ru/", "", "UTF-8");HttpPost
Method
Executes post request
Parameters
| Параметр | Описание |
|---|---|
url | Target address of request. |
content | The content of post request. |
contentPostingType | The type of content. |
proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
Encoding | Encoding format. |
respType | Response type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File). |
Timeout | Timeout in milliseconds of request. |
Cookies | Cookies for request. |
UserAgent | UserAgent for request. |
UseRedirect | true if use redirect; otherwise, false. |
MaxRedirectCount | Maximum count of redirects. |
AdditionalHeaders | An array of captures an array of additional headers. |
DownloadPath | Download path for file. |
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
Executes post request
Parameters
| Параметр | Описание |
|---|---|
url | Target address of request. |
content | The content of post request. |
contentPostingType | The type of content. |
proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
Encoding | Encoding format. |
respType | Response type (cane take values: BodyOnly, HeaderOnly, HeaderAndBody, File). |
Timeout | Timeout in milliseconds of request. |
Cookies | Cookies for request. |
UserAgent | UserAgent for request. |
UseRedirect | true if use redirect; otherwise, false. |
MaxRedirectCount | Maximum count of redirects. |
AdditionalHeaders | An array of captures an array of additional headers. |
DownloadPath | Download path for file. |
UseOriginalUrl | true if use original url; otherwise, false. |
Returns: The result of request.
HttpPostBytes
Method
Executes post request
Parameters
| Параметр | Описание |
|---|---|
url | Target address of request. |
content | The content of post request. |
contentPostingType | The type of content. |
proxy | Proxy string (for example: socks5://llogin:pass@8.5.6.7:8080). |
Encoding | Encoding format. |
Timeout | Timeout in milliseconds of request. |
Cookies | Cookies for request. |
UserAgent | UserAgent for request. |
UseRedirect | true if use redirect; otherwise, false. |
MaxRedirectCount | Maximum count of redirects. |
AdditionalHeaders | An array of captures an array of additional headers. |
UseOriginalUrl | true if use original url; otherwise, false. |
Returns: The result byte array of request.
Example
var resultHttpPostBytes = ZennoPoster.HttpPost("http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi",
"Comments=This+is%0D%0Asome+text%0D%0Ain+several+lines.&box=yes&hidden+field=something",
"application/x-www-form-urlencoded", "", "iso-8859-1");GetNewInstance
Method
Get the instance
Parameters
| Параметр | Описание |
|---|---|
url | Pipe host of instance (127.0.0.1). |
port | Instance port. |
address | Instance work mode. |
browserType | The browser type. The default value is BrowserType.Firefox45. |
browserArgs | The command line arguments for starting browser. |
Example
var url = "";
var port = 0;
var address = "";
// Gets parameters of instance
ZennoPoster.GetNewInstance(out url, out port, out address);
// Create new instance
var instance = new Instance(url, port, address);Example2
$url = "";
$port = 0;
$address = "";
// Gets parameters of instance
ZennoPoster::GetNewInstance($url, $port, $address);
// Create new instance
$instance = new Instance($url, $port, $address);ShowInstance
Method
Show the instance
Parameters
| Параметр | Описание |
|---|---|
url | Pipe host of instance (127.0.0.1). |
port | Instance port. |
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
Hide the instance
Parameters
| Параметр | Описание |
|---|---|
url | Pipe host of instance (127.0.0.1). |
port | Instance port. |
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
Release the instance
Parameters
| Параметр | Описание |
|---|---|
url | Pipe host of instance (127.0.0.1). |
port | Instance port. |
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
Recognizes the special captcha through the specified DLL library.
Parameters
| Параметр | Описание |
|---|---|
dllName | The path to DLL library. |
instance | The instance with captcha for recognition. |
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
Recognizes the captcha through the specified DLL library.
Parameters
| Параметр | Описание |
|---|---|
dllName | The path to DLL library. |
captcha | The captcha for recognition. |
parameters | The recognition parameters. |
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
Recognizes the captcha through the specified DLL library.
Parameters
| Параметр | Описание |
|---|---|
dllName | The path to DLL library. |
captcha | The captcha for recognition. |
parameters | The recognition parameters. |
asyncRecognize | true if need async way to recognize; otherwise and default, false. |
confidence | The result confidence. |
Returns: The recognition result or id of async task.
Example
public static int Execute(Instance instance)
{
instance.ClearCookie();
Tab tb = instance.MainTab;
if ((tb.IsVoid) || (tb.IsNull)) return -1;
if (tb.IsBusy) tb.WaitDownloading();
tb.Navigate("http://lessons.zennolab.com/ru/advanced");
if (tb.IsBusy) tb.WaitDownloading();
HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("img", "fulltag", "img", "text", 0);
string confidence;
string res = ZennoPoster.CaptchaRecognition("MonkeyEnter.dll", he.DrawToBitmap(true), "", false, out confidence);
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("recaptcha_response_field");
he.SetValue(res, "Middle", false);
return 0;
}ContextRecognition
Method
Recognizes the themes for the specified text.
Parameters
| Параметр | Описание |
|---|---|
text | The text for recognize. |
themesType | The themes type. It can be general or detailed. The detailed is not support now. |
maxThemes | The maximum count of the themes. |
relevance | The minimum relevance for the themes. |
Returns: The string which contains the all suitable themes written via separator.
CaptchaRecognition
Method
Recognizes the captcha through the specified DLL library.
Parameters
| Параметр | Описание |
|---|---|
dllName | The path to DLL library. |
parameters | The recognition parameters. |
captchas64Str | An array of captures an array of strings. |
asyncRecognize | true if need async way to recognize; otherwise and default, false. |
Returns: The recognition result or id of async task.
WaitCaptchaRecognition
Method
Wait the reconition task with specified id.
Parameters
| Параметр | Описание |
|---|---|
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
Returns the proxy with the removal.
Parameters
| Параметр | Описание |
|---|---|
filterName | The name of the filter. |
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
Returns the a proxy without removing it.
Parameters
| Параметр | Описание |
|---|---|
filterName | The name of the filter. |
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
Returns the text the resulting after handling mail.
Parameters
| Параметр | Описание |
|---|---|
timeoutSec | Timeout specified in seconds. Three in a row above the number recorded by ”;“. |
login | The login for mail. |
pass | The password for mail. |
server | The mail server. |
identityRegExp | The regular expression to identify email. |
parserRegExp | The regular expression for select the contents of email. |
port | The server port. |
useSSL | true if use SSL; otherwise, false. |
useHTML | true if parse HTML; otherwise, false. |
useIMAP | true if use IMAP; otherwise, false. |
removeMessages | true if remove messages; otherwise, false. |
machNum | Number of match. |
throwsException | true if need to throw exceptions; otherwise and default, false. Standart types of exeption contains in CommandCenter.Exceptions.Mail namespace. |
imapFolderNames | An array of names of imap folders. |
proxyString | Proxy string in format: login:pass@ip:port OR ip:port. |
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
Validate Email address using login and password.
Parameters
| Параметр | Описание |
|---|---|
login | The login for mail. |
pass | The password for mail. |
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
Validate Email address using extended parameters.
Parameters
| Параметр | Описание |
|---|---|
login | The login for mail. |
pass | The password for mail. |
server | The mail server. |
port | The server port. |
useSSL | true if use SSL; otherwise, false. |
useIMAP | true if use IMAP; otherwise, false. |
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
Downloads the messages from the specified account.
Parameters
| Параметр | Описание |
|---|---|
login | The login for mail (usualy your email address). |
pass | The password for mail. |
server | The mail server. Default value is blank, ZennoPoster will try to determine your the settings. |
port | The server port. Default value is 143 |
useSSL | true if use SSL; otherwise, false. Default value is true |
protocol | IMAP or POP3. Default value is IMAP. |
lastHours | If message older than specified amount of hours will not be returned. Default value is 2 hours |
maxCount | Max count of messages. Default value is 100. |
deleteMessages | true if remove messages; otherwise, false. Default value is false. |
proxyString | Proxy string in format: login:pass@ip:port OR ip:port. |
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
Download the file
Parameters
| Параметр | Описание |
|---|---|
host | Address of the FTP server. |
port | Port of the FTP server. |
login | Login of the FTP server |
pass | Password of the FTP server |
proxy | Proxy string in format: login:pass@ip:port OR ip:port |
name | File name. |
localPath | Destination path. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
var list = new System.Collections.Generic.List<string>(ZennoPoster.FtpGetList({host}, {port}, {login}, {password}, {proxy}, "", false, false));
foreach(var item in list)
ZennoPoster.FtpDownload({host}, {port}, {protocol}, {login}, {password}, {proxy}, item, {directoryToSavePath});Example2
$list = new System::Collections::Generic::List<string>(ZennoPoster::FtpGetList({host}, {port}, {login}, {password}, {proxy}, "", false, false));
foreach($item as $list)
ZennoLab\CommandCenter\ZennoPoster::FtpDownload({host}, {port}, {protocol}, {login}, {password}, {proxy}, $item, {directoryToSavePath});FtpUploadFile
Method
Uploads the specified file.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
serverPath | The destination path. |
localPath | The path to the file. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
ZennoPoster.FtpUploadFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryToUploadPath}, {filePath});Example2
ZennoLab\CommandCenter\ZennoPoster::FtpUploadFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryToUploadPath}, {filePath});FtpUploadDirectory
Method
Uploads the specified directory.
This method uploads directory and overwrite all exit items.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
serverPath | The destination path. |
localPath | The path to the file. |
recursive | The true for uploading all subdirectories, and files in localPath; otherwise, false. |
uncludeRootName | The true for include root directory name; otherwise, false. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
// upload all items from local directory to the directory with same name on ftp server
ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
// upload all items from local directory to the with path "ftp_path"
ZennoPoster.FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);Example2
// upload all items from local directory to the directory with same name on ftp server
ZennoLab\CommandCenter\ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, true);
// upload all items from local directory to the with path "ftp_path"
ZennoLab\CommandCenter\ZennoPoster::FtpUploadDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "ftp_path", "local_path", true, false);FtpDeleteFile
Method
Delete the file.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
name | The file name. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
ZennoPoster.FtpDeleteFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {filePath});Example2
ZennoLab\CommandCenter\ZennoPoster::FtpDeleteFile({host}, {port}, {protocol}, {login}, {password}, {proxy}, {filePath});FtpDeleteDirectory
Method
Delete the directory.
This method delete the directory even if specified directory contains others directories or files.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
name | The directory name. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
ZennoPoster.FtpDeleteDirectory({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryName});Example2
ZennoLab\CommandCenter\ZennoPoster::FtpDeleteDirectory({host}, {port}, {protocol}, {login}, {password}, {proxy}, {directoryName});FtpCreateDirectory
Method
Create a directory with the specified name.
The parameter “name” can be directory name (for example: Folder) or directory path (for example: Folder\SubFolder). There are two ways specify the directory path. See example.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
name | The directory name. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
// create a new directory with name "newDirectory" on "host_name"
ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "newDirectory");
// create a new directory with name "NewDirectory\newDirectory" on "host_name"
ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory\\newDirectory");
// or this way
ZennoPoster.FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory/newDirectory");Example2
// create a new directory with name "newDirectory" on "host_name"
ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "newDirectory");
// create a new directory with name "NewDirectory\newDirectory" on "host_name"
ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory\\newDirectory");
// or this way
ZennoLab\CommandCenter\ZennoPoster::FtpCreateDirectory("host_name", {port}, "protocol", "login", "password", "proxy", "NewDirectory/newDirectory");FtpChmode
Method
Changes the access mode of specified ftp item.
For changing mode on ftp server you should make sure that current server support the “SITE CHMOD” command otherwise, this operation can not be performed. The specified item can be file or directory. In case if specified item is the directory, the mode will be changed only for this ftp item, all internal files and subdirectories will not change the mode.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
serverPath | The path of ftp item. |
mode | The mode for specified item. This a string value can be empty, in this case the mode of item will be “000”. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Example
// change mode for file located on path MyFolder\MyTXTFile.txt
ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MyTXTFile.txt", "774");
// change mode for directory located on path MyFolder\MySubFolder
ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", @"MyFolder\MySubFolder", "755");Example2
// change mode for file located on path MyFolder\MyTXTFile.txt
ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MyTXTFile.txt", "774");
// change mode for directory located on path MyFolder\MySubFolder
ZennoLab\CommandCenter\ZennoPoster.FtpChmode("your_host_name", 21, "protocol", "login", "password", "proxy", "MyFolder\\MySubFolder", "755");FtpGetList
Method
Returns all files in the directory.
Parameters
| Параметр | Описание |
|---|---|
host | The address of the FTP server. |
port | The port of the FTP server. |
login | The login of the FTP server. |
pass | The password of the FTP server. |
proxy | The proxy string in format: login:pass@ip:port OR ip:port. |
directoryName | The directory name. |
recursive | The true if use recursion; otherwise, false. |
includeDirectory | The true if use subdirectories; otherwise, false. |
protocol | The FTP protocol. It can be “FTP”, “sFTP”, or “FTPs”. |
Returns: The list of all files and directories represented by collection of the IEnumerable interface.
Example
var list = new System.Collections.Generic.List<string>(ZennoPoster.FtpGetList({host}, {port}, {protocol}, {login}, {password}, {proxy}, "", false, false));Example2
$list = new System::Collections::Generic::List<string>(ZennoLab\CommandCenter\ZennoPoster::FtpGetList({host}, {port}, {protocol}, {login}, {password}, {proxy}, "", false, false));ImageProcessingUntreatedFromScreenshot
Method
Untreated image from screenshot.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Параметр | Описание |
|---|---|
path | The save file path. |
instancePort | The port of the instance. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
url | The url of the image. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
filePath | The file path of the image for processing. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
instancePort | The port of the instance. |
width | A new width of the image. |
height | A new height of the image. |
keep | If need to keep the aspect ratio then “true”; otherwise “false”. |
units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
notIncImage | If not increase size of the image then “true”; otherwise “false”. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
url | The url of the image. |
width | A new width of the image. |
height | A new height of the image. |
units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
keep | If need to keep the aspect ratio then “true”; otherwise “false”. |
notIncImage | If not increase size of the image then “true”; otherwise “false”. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
filePath | The file path of the image for processing. |
width | A new width of the image. |
height | A new height of the image. |
units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
keep | If need to keep the aspect ratio then “true”; otherwise “false”. |
notIncImage | If not increase size of the image then “true”; otherwise “false”. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
leftBorder | The indent from left border of the image. |
topBorder | The indent from top border of the image. |
cropWidth | The width for cropping. |
cropHeight | The height for cropping. |
units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
instancePort | The port of the instance. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
leftBorder | The indent from left border of the image. |
topBorder | The indent from top border of the image. |
cropWidth | The width for cropping. |
cropHeight | The height for cropping. |
units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
url | The url of the image. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
filePath | The file path of the image for processing. |
savePath | The save file path. |
leftBorder | The indent from left border of the image. |
topBorder | The indent from top border of the image. |
cropWidth | The width for cropping. |
cropHeight | The height for cropping. |
units | Units of dimension of the parameters. It can be “pixel” or “percent”. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
instancePort | The port of the instance. |
angle | An angle of the rotation. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
url | The url of the image. |
angle | An angle of the rotation. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
filePath | The file path of the image for processing. |
angle | An angle of the rotation. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
transparency | The transparency of the water mark. The value from 0 to 100. |
imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
instancePort | The port of the instance. |
location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
text | The text of the water mark. |
style | The string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue] |
offsetLeft | The offset from left. Default value is 0. |
offsetTop | The offset from top. Default value is 0. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
url | The url of the image. |
transparency | The transparency of the water mark. The value from 0 to 100. |
imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
text | The text of the water mark. |
style | The string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue] |
offsetLeft | The offset from left. Default value is 0. |
offsetTop | The offset from top. Default value is 0. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
filePath | The file path of the image for processing. |
transparency | The transparency of the water mark. The value from 0 to 100. |
imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
text | The text of the water mark. |
style | The string of the style in format: [Font], [Size]pt, [TextSyle], … , [TextSyle], [Color_alfa, Color_red, Color_green, Color_blue] |
offsetLeft | The offset from left. Default value is 0. |
offsetTop | The offset from top. Default value is 0. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
instancePort | The port of the instance. |
imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
path | The file path of the image which will be a water mark. |
transparency | The transparency of the water mark. The value from 0 to 100. |
offsetLeft | The offset from left. Default value is 0. |
offsetTop | The offset from top. Default value is 0. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
url | The url of the image. |
transparency | The transparency of the water mark. The value from 0 to 100. |
imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
path | The file path of the image which will be a water mark. |
offsetLeft | The offset from left. Default value is 0. |
offsetTop | The offset from top. Default value is 0. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
savePath | The save file path. |
filePath | The file path of the image for processing. |
imposition | The type of the imposition. It can be “horizontally” or “diagonally”. |
location | The type of the location. It can be “center”, “leftbottom”, “lefttop”, “rightbottom” or “righttop”. |
path | The file path of the image which will be a water mark. |
transparency | The transparency of the water mark. The value from 0 to 100. |
offsetLeft | The offset from left. Default value is 0. |
offsetTop | The offset from top. Default value is 0. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
mirror | The type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive. |
savePath | The save file path. |
instancePort | The port of the instance. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
mirror | The type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive. |
savePath | The save file path. |
url | The url of the image. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
filePath | The file path of the image for processing. |
savePath | The save file path. |
mirror | The type of the mirror reflection. It can be “Horizontal”, “Vertical”, “HorizontalVertical”. This parameter is not case-sensitive. |
quality | The image quality. The value from 0 to 100. Default value is 100. |
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
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
| Параметр | Описание |
|---|---|
quality | The image quality. The value from 0 to 100. Default value is 100. |
savePath | The save file path. |
instancePort | The port of the instance. |
Example
// clear exif for image from screenshot
ZennoPoster.ImageProcessingClearExifFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100);Example2
// clear exif for image from screenshot
ZennoPoster::ImageProcessingClearExifFromScreenshot(instance.Port, "C:\\ResultImage.jpeg", 100);ImageProcessingClearExifFromUrl
Method
Performs clearing all EXIF tags in metadata of image loaded from url.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Параметр | Описание |
|---|---|
quality | The image quality. The value from 0 to 100. Default value is 100. |
savePath | The save file path. |
url | The url of the image. |
Example
// clear exif for image from url
ZennoPoster.ImageProcessingClearExifFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100);Example2
// clear exif for image from url
ZennoPoster::ImageProcessingClearExifFromUrl("someurl.com/image.php", "C:\\ResultImage.jpeg", 100);ImageProcessingClearExifFromFile
Method
Performs clearing all EXIF tags in metadata of image loaded from file.
If parameter of quality not in the range from 0 to 100 then this value will be changed to 100.
Parameters
| Параметр | Описание |
|---|---|
filePath | The file path of the image for processing. |
savePath | The save file path. |
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
Add a new task.
Parameters
| Параметр | Описание |
|---|---|
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
Remove the task
Parameters
| Параметр | Описание |
|---|---|
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
Get the information of task
Parameters
| Параметр | Описание |
|---|---|
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
Get the information of task
Parameters
| Параметр | Описание |
|---|---|
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
Stop the task by id.
Parameters
| Параметр | Описание |
|---|---|
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
Stop the task by name.
Parameters
| Параметр | Описание |
|---|---|
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
Interrupt the task by id.
Parameters
| Параметр | Описание |
|---|---|
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
Interrupt the task by name.
Parameters
| Параметр | Описание |
|---|---|
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
Start the task by id.
Parameters
| Параметр | Описание |
|---|---|
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
Start the task by name.
Parameters
| Параметр | Описание |
|---|---|
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
Adds tries to the task
Parameters
| Параметр | Описание |
|---|---|
id | Id of task. |
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
Adds tries to the task
Parameters
| Параметр | Описание |
|---|---|
name | Name of task. Finds the first occurrence. |
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
Sets tries to the task by id.
Parameters
| Параметр | Описание |
|---|---|
id | Id of task. |
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
Sets max threads to the task by id.
Parameters
| Параметр | Описание |
|---|---|
id | Id of task. |
count | Count of tries to set. |
SetTries
Method
Sets tries to the task by name.
Parameters
| Параметр | Описание |
|---|---|
name | Name of task. Finds the first occurrence. |
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
Sets max threads to the task by name.
Parameters
| Параметр | Описание |
|---|---|
name | Name of task. Finds the first occurrence. |
count | Count of tries to set. |
ClearSuccess
Method
Clear success of the task by id.
Parameters
| Параметр | Описание |
|---|---|
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
Clear fails of the task by id.
Parameters
| Параметр | Описание |
|---|---|
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
Clear success of the task by name.
Parameters
| Параметр | Описание |
|---|---|
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
Clear fails of the task by name.
Parameters
| Параметр | Описание |
|---|---|
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
Set the execution settings by id.
Parameters
| Параметр | Описание |
|---|---|
id | Id task to change execution settings. |
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
Set the execution settings by name.
Parameters
| Параметр | Описание |
|---|---|
name | Name of task to change execution settings. Finds the first occurrence. |
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
Set the sсheduler settings by id.
Parameters
| Параметр | Описание |
|---|---|
id | Id of task to change scheduler settings. |
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
Set the sсheduler settings by name.
Parameters
| Параметр | Описание |
|---|---|
name | Name of task to change scheduler settings. Finds the first occurrence. |
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
Export the input settings
Parameters
| Параметр | Описание |
|---|---|
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
Export the input settings.
Parameters
| Параметр | Описание |
|---|---|
id | Id of task to export settings. |
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
Returns count of tasks that currently running
Returns: Count of threads.
Example
int count = ZennoPoster.GetThreadsCount();GetThreadsCount
Method
Returns count of threads for certain tasks
Parameters
| Параметр | Описание |
|---|---|
name | Name of a task. |
Returns: Count of threads.
Example
int count = ZennoPoster.GetThreadsCount(taskName);GetThreadsCount
Method
Returns count of threads for certain tasks
Parameters
| Параметр | Описание |
|---|---|
id | Id of a task. |
Returns: Count of threads.
Example
int count = ZennoPoster.GetThreadsCount(taskName);