Receiving Output Error through .NET API - VisualCron - Forum

Community forum

I put my current code below. I need to loop through all the jobs. If the state of the job is failed. I need to display the Output(Error) Message as it displays when checking directly in visual cron. How do I get the Output(Error) Message for the Job?

Server s = new Server();
Client c = new Client();
Connection conn = new Connection();
conn.ConnectionType = Connection.ConnectionT.Remote;
conn.Address = "***.**.**.***"; //Con1
conn.TimeOut = 10 * 60; // 10 Mins
conn.UserName = "admin";
conn.PassWord = "";
var connTest = c.Connect(conn, true);
s = connTest;

List<JobClass> lJobs = new List<JobClass>();

var lOrderedJobsByName = lJobs.OrderBy(x => x.Name);

foreach (var j in lOrderedJobsByName)

It seems that you are using VisualCron .NET API, not the VisualCron Web API so I have edited the subject to avoid misunderstanding.

Output and error output is associated with a Task in a Job so first you should:
1. Get a list of Tasks in the Job
2. For each Task in the list,
you can get the 'StandardError'.
For sample code on how to accomplish 1 and 2, please refer to the sample project provided in the API folder of the VisualCron installation directory.
Please find some relevant excerpts from this project below:

void Processes_TaskProcessEndedStatic(ref Server server, VCTaskProcessClass tpc)
if (tpc.HasStandardOutput)
LogTaskOutputClass taskOutput = server.Log.GetTaskOutput(tpc.UniqueId, tpc.TaskId, tpc.TaskPId);
if (taskOutput != null)
// taskOutput.StandardError

Please like  VisualCron on facebook!
Scroll to Top