Issue with Instance Object?

  • Автор темы Автор темы Rico
  • Дата начала Дата начала

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,

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
 
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
 
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.
 
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
 

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