Hello support,
I have the following code for .NET API.
I'd like to get more information about the task depending of TaskType and TaskId.
For example, if the task type is "CopyFile", get the values of "Source Folder", "Destination Folder", and "File Mask";
if the task is "Execut" return the value of "Execute", or "PowerShell" return the path of the "Powershell file", etc.
Also, if it possible to get the ifnormation about status of the task (if is Active or not)
How can I return this information?
Best regards,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VisualCron;
using VisualCronAPI;
using static VisualCron.JobClass;
namespace VisualCronAPIFrame
{
internal class Program
{
static void Main(string[] args)
{
try
{
Server s;
Client c = new Client();
Connection conn = new Connection();
conn.ConnectionType = Connection.ConnectionT.Remote;
conn.Address = "<server>";
conn.Port = 16444;
//conn.Token = null; //Logon Token
conn.UserName = "userName";
conn.PassWord = "securePass";
Console.WriteLine("Hello " + conn.Address);
s = c.Connect(conn, true);
foreach (JobClass j in s.Jobs.GetAll())
{
foreach (TaskClass t in j.Tasks)
{
Console.WriteLine(j.Id + "¬" + j.Group + "¬" + j.Name + "¬" + t.Name + "¬" + t.Id + "¬" + t.TaskType);
}
}
s.Disconnect();
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
}