Issue with Instance Object?

Rico

Новичок
Регистрация
09.07.2011
Сообщения
4
Благодарностей
0
Баллы
0
Hello,

I am using ZennoPoster in C# using .Net 3.5. I have tried several different ways to properly instantiate the Instance object. To get started, I am using the example code as follows:

Код:
using System;
using Zennolab.CommandCenter;
 
namespace Sample
{
    internal class Example
    {
        public static int Execute()
        {
            Instance instance = new Instance("http://www.microsoft.com", 80, "server");
            
            instance.ClearCookie();
 
            instance.ClearCache();
            
            Tab tab = instance.MainTab;
            if (tab.IsNull) return -1;
	
	// This is always true....	
            if (tab.IsVoid) return -1;
            tab.Navigate("zennolab.com");
            if (tab.IsBusy) tab.WaitDownloading();
            
            return 0;
        }
    }
}
It seems like no what parameters I pass the IsVoid is always true. Is this an issue or am I am missing something?

I appreciate your help.

Thanks,

Rico
 

shade

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

Rico

Новичок
Регистрация
09.07.2011
Сообщения
4
Благодарностей
0
Баллы
0
Shade,

Thanks for answering. It looks fine in Code Creator.

In Visual Studio 2008, the IsVoid property is always true. I have tried several different combinations to instantiate the Instance object properly. I have had no luck.

Do you have any ideas, my friend?

Thanks,

Rico
 

Rico

Новичок
Регистрация
09.07.2011
Сообщения
4
Благодарностей
0
Баллы
0
Fellow ZPers,

I am calling it from a .NET exe in Visual Studio. Does there need to be some setup before you can create the Instance object?

Thanks Again,

Rico
 

darkdiver

Administrator
Команда форума
Регистрация
13.01.2009
Сообщения
2 284
Благодарностей
2 728
Баллы
113
First we need to understand what are you trying to do?
After export template to the visual studio, you will have a configured project for dll, which can be loaded by the ZennoPoster.
It will be debugged with the special application, to debug it code creator should be opened.
Then you can just run the ZennoPoster and load resulting dll.
Also please do not edit signature of method execute
It should be
PHP:
public static int Execute(Instance instance)
ZennoPoster will initialize instance object automatically.
 

Rico

Новичок
Регистрация
09.07.2011
Сообщения
4
Благодарностей
0
Баллы
0
DD,

I am back to this... finally. I guess I need to explain a bit more. :-)

Objective:

Execute ZennoPoster methods from my custom .NET exe. Since this would be used by my clients, they would not have a copy of ZennoPoster on their machine.

I am assuming it is possible based on the ZennoPoster web site:

Support for controlling the browser from your code

For those who know the PHP or C# programming languages we have designed classes of controlling the browser from your own code, i.e. instead of the template you can create your own program fully controlling the browser. You can use all the advantages provided by these languages and at the same time manage your browser.

I created the code... But, I cannot for some reason instantiate the Instance object in C#..... It just creates any "empty" object. Any ideas?

Thanks,

Rich
 

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