Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline klr  
#1 Posted : Tuesday, July 29, 2014 10:35:59 AM(UTC)
klr

Rank: No customer

Joined: 12/13/2012(UTC)
Posts: 15
Denmark
Location: Aarhus

I am trying to get content of a Job Variable using the API in C#, but it seems to be encrypted...

JobClass MyJob = s.Jobs.GetJobByName("MyJobName");
var TimeFunctiona = MyJob.GetJobVariable("myjobvar").ValueObject;

gives a byte array of the correct length, but I can not figure out how to convert the byte array to the correct variable content. It seem to be encoded.

How can I decode this ?

Regards
/Klaus
Offline Support  
#2 Posted : Wednesday, July 30, 2014 5:23:58 PM(UTC)
Support

Rank: Official support

Medals:
Joined: 2/23/2008(UTC)
Posts: 9,431

Thanks: 575 times
Was thanked: 326 time(s) in 314 post(s)
We added this for the 7.2.0 beta which you can download here:

http://www.visualcron.co....aspx?g=posts&t=4259

Here is a sample:

Code:
using System;
using VisualCron;
using VisualCronAPI;

public class Test
{
 public static string ConnectMe()
 {
 	Client c = new Client();
 	Connection conn = new Connection();
 	Server s = c.Connect(conn,true);
 	// add or update
 	s.Jobs.JobVariables.AddUpdate("{JOB(Active|Id)}","testkey","testvalue47");
 	// get Job Variable value
 	string value = s.Jobs.JobVariables.GetValue("{JOB(Active|Id)}","testkey");
 	// delete Job Variable
	s.Jobs.JobVariables.Delete("{JOB(Active|Id)}","testkey");
	return value;
 }
}
Henrik
Support
http://www.visualcron.com

Please like VisualCron on facebook!
Offline klr  
#3 Posted : Thursday, July 31, 2014 8:10:45 AM(UTC)
klr

Rank: No customer

Joined: 12/13/2012(UTC)
Posts: 15
Denmark
Location: Aarhus

Looks great, but what key is used if the JobVariable is added in the VisualCron Client application ?

Regards
/Klaus

Edited by user Thursday, July 31, 2014 8:12:09 AM(UTC)  | Reason: Not specified

Users browsing this topic
Guest (2)
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.140 seconds.
Scroll to Top