Variable in C#

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
Hi,
my c code for mail download is:

Код:
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("[email protected]",
       "password", "mail.example.com", 110, false,
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3,
       24*100, 10000, 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);
}
it works fine if I put email directly in code, but if I put:
{-Variable.email-}
instead [email protected]

it will not work in ZP, but this work in project creator.
My version is 5.3.1.0
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
project.Variables["email"].Value instead of {-Variable.email-}
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
like this?:
Код:
Tuple<string, string, string, string>[] allMails;
allMails = ZennoPoster.BulkMailDownload("project.Variables["email"].Value",
       "password", "mail.example.com", 110, false,
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3,
       24*100, 10000, 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);
}
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
ok i found out it must be like this, without quotation marks:
Код:
allMails = ZennoPoster.BulkMailDownload(project.Variables["email"].Value,
       "password", "mail.example.com", 110, false,
       ZennoLab.InterfacesLibrary.Enums.Email.EmailProtocol.POP3,
       24*100, 10000, false);

but I have another problem, because im not c# programmer ;p, i use this:

Код:
ZennoPoster.FtpCreateDirectory("user.example.com", 21, "ftp", "user", "pass", "proxy", "/public_html/domain");
and I would like to put 2 variables instead /public_html/domain

variableone is name
variabletwo is domain

so i put this, which doesnt work :-):

Код:
ZennoPoster.FtpCreateDirectory("user.example.com", 21, "ftp", "user", "pass", "proxy", "/public_html/"project.Variables["name"].Value"."project.Variables["domain"].Value);
new directory should be /public_html/name.domain
 

qlwik

Client
Регистрация
03.04.2013
Сообщения
207
Благодарностей
5
Баллы
18
ok got it its:
Код:
ZennoPoster.FtpCreateDirectory("user.example.com", 21, "ftp", "user", "pass", "proxy", "/public_html/" + project.Variables["name"].Value + "." + project.Variables["domain"].Value);
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)