We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Read task features with Aspose.Tasks for .NET 8.0.0

Hi all, using the last version of Aspose.Tasks ( I cannot read some information form an Aspose.Tasks.Task, such as Id, Uid, Name, Start, and Finish.

How could I do that?



Hi Diego,

Please use following code for achieving this requirement:

static void TestReadProject()
Project prj = new Project(@“D:\Sample.mpp”);
// Create a ChildTasksCollector instance
ChildTasksCollector collector = new ChildTasksCollector();

// Collect all the tasks from RootTask using TaskUtils
TaskUtils.Apply(prj.RootTask, collector, 0);

// Parse through all the collected tasks
foreach (Task tsk in collector.Tasks)
Console.WriteLine(“Id: {0}”, tsk.Get(Tsk.Id));
Console.WriteLine(“Uid: {0}”, tsk.Get(Tsk.Uid));
Console.WriteLine(“Name: {0}”, tsk.Get(Tsk.Name));
Console.WriteLine(“Start: {0}”, tsk.Get(Tsk.Start));
Console.WriteLine(“Finish: {0}”, tsk.Get(Tsk.Finish));