code creator issue

dafeet

Новичок
Регистрация
08.06.2012
Сообщения
5
Благодарностей
0
Баллы
0
i've been working on using code creator with a template but for some reason i can't get it to work with File.GetString, i've looked all over for an answer and i still don't understand what i've done wrong. here is a sample of how i'm trying to work with File.GetString in code creator. Any advice is much appreciated.

PHP:
<?php
import namespace System;
import namespace Zennolab:::CommandCenter;

class Step1
{
	public static function Execute($instance)
	{
		// Going to http://lessons.zennolab.com/en/registration
		$tb = $instance->MainTab;
		if (($tb->IsVoid) || ($tb->IsNull)) return -1;
		if ($tb->IsBusy) $tb->WaitDownloading();
		$tb->Navigate("http://lessons.zennolab.com/en/registration");
		if ($tb->IsBusy) $tb->WaitDownloading();

		// Setting value [email] to the element with tag [input:text]
		
		$emaila = $instance->RiseMacros("File.GetString", array( "\\Resources\\email.txt", "random", "false" ));
		
		$email = $instance->RiseMacros("String.Split", array( $emaila, ":", "0" ));
		
		$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("email");
		if ($he->IsVoid) {
			$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:text", "fulltag", "input:text", "text", 0);
		}
		if ($he->IsVoid) return -1;
		
		$he->SetValue($email, true);

		// Executing macros
		//$he->SetValue($instance->RiseMacros("File.GetString", array( "\Resources\email.txt", "random", "false" )), true);

		return 0;
	}
}
?>
 

dafeet

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

purush84

Client
Регистрация
07.11.2011
Сообщения
259
Благодарностей
38
Баллы
0
:confused:
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
835
Баллы
113
Hi there, try to use path Resources\\email.txt instead of \\Resources\\email.txt
 

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