how make "go to page" in codecreator

jen

Client
Регистрация
17.09.2011
Сообщения
33
Благодарностей
0
Баллы
6
hello,

do you know how make a go to page of mail adress in the codecreator ?


Код:
using System;
using Zennolab.CommandCenter;

namespace macro
{
	internal class MailStep1
	{
		public static string MailConfirm(Instance instance)
		{
			// http://www...
			var res = ZennoPoster.MailConfirm(instance, "30;60;120", "[email protected]", "PASSWORD", "pop3.live.com", 995, false, false,
						 "TITRE ", "http:\\/\\/www\\.ADRESSE\\.com.*");
			
			return res;

Код:
Tab tb = instance.GetTabByAddress("res");
			if ((tb.IsVoid) || (tb.IsNull)) return -1;
			if (tb.IsBusy) tb.WaitDownloading();
			tb.Navigate("res");
			if (tb.IsBusy) tb.WaitDownloading();
			return 0;
Thanks for your answers.
 

shade

Client
Регистрация
19.11.2010
Сообщения
580
Благодарностей
346
Баллы
63
hello,

do you know how make a go to page of mail adress in the codecreator ?


Код:
using System;
using Zennolab.CommandCenter;

namespace macro
{
    internal class MailStep1
    {
        public static string MailConfirm(Instance instance)
        {
            // http://www...
            var res = ZennoPoster.MailConfirm(instance, "30;60;120", "[email protected]", "PASSWORD", "pop3.live.com", 995, false, false,
                         "TITRE ", "http:\\/\\/www\\.ADRESSE\\.com.*");
            
            return res;

Код:
Tab tb = instance.GetTabByAddress("res");
            if ((tb.IsVoid) || (tb.IsNull)) return -1;
            if (tb.IsBusy) tb.WaitDownloading();
            tb.Navigate("res");
            if (tb.IsBusy) tb.WaitDownloading();
            return 0;
Thanks for your answers.
Write in detail what you need.
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
If you need to go by address which you got from email (in variable res)
So just use tb.Navigate(res);
 
  • Спасибо
Реакции: jen

jen

Client
Регистрация
17.09.2011
Сообщения
33
Благодарностей
0
Баллы
6
Hello,

I still don't have "go to page" when I put "tb.navigate"


Код:
using System;
using Zennolab.CommandCenter;

namespace gotopage
{
	internal class Step1
	{
		public static int Execute(Instance instance)
		{
			
		 
			string tt = instance.RiseMacros("File.GetString", new [] { "\\Results\\mail-confirm.txt", "0", "false" });
			

			// Going to page
			Tab tb = instance.GetTabByAddress(tt);
                        tb.Navigate(tt);
                        return 0;
			
		}
	}
}




Thanks for your answers.:-)
 

shade

Client
Регистрация
19.11.2010
Сообщения
580
Благодарностей
346
Баллы
63
Hello,

I still don't have "go to page" when I put "tb.navigate"


Код:
using System;
using Zennolab.CommandCenter;

namespace gotopage
{
    internal class Step1
    {
        public static int Execute(Instance instance)
        {
            
         
            string tt = instance.RiseMacros("File.GetString", new [] { "\\Results\\mail-confirm.txt", "0", "false" });
            

            // Going to page
            Tab tb = instance.GetTabByAddress(tt);
                        tb.Navigate(tt);
                        return 0;
            
        }
    }
}




Thanks for your answers.:-)
This is because you wrong get tab. By default instance have one tab named "page". Method GetTabByAddress returns tab with name which you give else returns "null". If you want to create a new tab you must call method NewTab:
Код:
instance.NewTab("new name");
. If you want use exist tab (for example: "page") you should call property
Код:
instance.MainTab;
or call method
Код:
instance.GetTabByAddress("page");
In your code instance contains one tab with name "page" and have not tab named by value of variable tt. That is why your can't navigate it, create a new tab with this name or use main tab.
 
  • Спасибо
Реакции: jen

jen

Client
Регистрация
17.09.2011
Сообщения
33
Благодарностей
0
Баллы
6
Hello,

When I go to page in a single macro is good,
but when I integrated in another, it didn't work.

Program.cs :

Код:
using System;
using Zennolab.CommandCenter;

namespace macroyoutube4
{
	class Program : IZennoCustomCode
	{
		public int ExecuteCode(Instance instance)
		{
			Step1.Execute(instance);
			MailStep1.MailConfirm(instance);
			return 0;
		}
	}
}
MailStep1.cs :

Код:
using System;
using Zennolab.CommandCenter;

namespace macroyoutube4
{
	internal class MailStep1
	{
		public static string MailConfirm(Instance instance)
		{
			string bizi = instance.RiseMacros("File.GetString", new [] { "\\Resources\\adresses_hotmail_pour_youtube.txt", "0", "false" });
            string maili = instance.RiseMacros("String.Split", new [] { bizi, ":", "0" });
			
			string bizii = instance.RiseMacros("File.GetString", new [] { "\\Resources\\adresses_hotmail_pour_youtube.txt", "0", "true" });
            string passi = instance.RiseMacros("String.Split", new [] { bizii, ":", "1" });
			
			
			// https://accounts.google.com/VE?service=youtube&...
			var res = ZennoPoster.MailConfirm(instance, "30;60;120", maili, passi, "pop3.live.com", 995, false, false,
						 "account-verification", "https:\\/\\/accounts\\.google\\.com.*fr");
			
			
			// Going to page
			instance.NewTab(res);
			return res;
		}
	}
}


Thanks for your answers. :-)
 

shade

Client
Регистрация
19.11.2010
Сообщения
580
Благодарностей
346
Баллы
63
Hello,

When I go to page in a single macro is good,
but when I integrated in another, it didn't work.

Program.cs :

Код:
using System;
using Zennolab.CommandCenter;

namespace macroyoutube4
{
    class Program : IZennoCustomCode
    {
        public int ExecuteCode(Instance instance)
        {
            Step1.Execute(instance);
            MailStep1.MailConfirm(instance);
            return 0;
        }
    }
}
MailStep1.cs :

Код:
using System;
using Zennolab.CommandCenter;

namespace macroyoutube4
{
    internal class MailStep1
    {
        public static string MailConfirm(Instance instance)
        {
            string bizi = instance.RiseMacros("File.GetString", new [] { "\\Resources\\adresses_hotmail_pour_youtube.txt", "0", "false" });
            string maili = instance.RiseMacros("String.Split", new [] { bizi, ":", "0" });
            
            string bizii = instance.RiseMacros("File.GetString", new [] { "\\Resources\\adresses_hotmail_pour_youtube.txt", "0", "true" });
            string passi = instance.RiseMacros("String.Split", new [] { bizii, ":", "1" });
            
            
            // https://accounts.google.com/VE?service=youtube&...
            var res = ZennoPoster.MailConfirm(instance, "30;60;120", maili, passi, "pop3.live.com", 995, false, false,
                         "account-verification", "https:\\/\\/accounts\\.google\\.com.*fr");
            
            
            // Going to page
            instance.NewTab(res);
            return res;
        }
    }
}


Thanks for your answers. :-)
I didn't find any mistakes except that you created a new tab but didn't navigated it. Method NewTab just create a new void tab. After method NewTab you must call method
Код:
instance.GetTabByAddress(res).Navigate(res);
and then instance will navigate to this URL.
 
  • Спасибо
Реакции: jen

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