how make "go to page" in codecreator

jen

Client
Joined
Sep 17, 2011
Messages
33
Reaction score
0
Points
6
hello,

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


Code:
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", "NOM@mail.COM", "PASSWORD", "pop3.live.com", 995, false, false,
						 "TITRE ", "http:\\/\\/www\\.ADRESSE\\.com.*");
			
			return res;

Code:
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
Joined
Nov 19, 2010
Messages
580
Reaction score
346
Points
63
hello,

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


Code:
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", "NOM@mail.COM", "PASSWORD", "pop3.live.com", 995, false, false,
                         "TITRE ", "http:\\/\\/www\\.ADRESSE\\.com.*");
            
            return res;

Code:
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
Joined
Jan 12, 2011
Messages
3,441
Reaction score
837
Points
113
If you need to go by address which you got from email (in variable res)
So just use tb.Navigate(res);
 
  • Thank you
Reactions: jen

jen

Client
Joined
Sep 17, 2011
Messages
33
Reaction score
0
Points
6
Hello,

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


Code:
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
Joined
Nov 19, 2010
Messages
580
Reaction score
346
Points
63
Hello,

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


Code:
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:
Code:
instance.NewTab("new name");
. If you want use exist tab (for example: "page") you should call property
Code:
instance.MainTab;
or call method
Code:
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.
 
  • Thank you
Reactions: jen

jen

Client
Joined
Sep 17, 2011
Messages
33
Reaction score
0
Points
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 :

Code:
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 :

Code:
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
Joined
Nov 19, 2010
Messages
580
Reaction score
346
Points
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 :

Code:
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 :

Code:
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
Code:
instance.GetTabByAddress(res).Navigate(res);
and then instance will navigate to this URL.
 
  • Thank you
Reactions: jen

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)