How do I know Uid of the task?

Hello,

lets say I have just added new task to the project:
Task task = rootTask.Children.Add(“new task”);

How do I know Uid of the task?

Thank you.

Hi Vladimir,

Thank you for contacting Aspose support team.

You may please use following sample code to retrieve the value.

Project prj = new Project();
Task tsk1 = prj.RootTask.Children.Add(“Task 1”);
Task tsk2 = prj.RootTask.Children.Add(“Task 2”);
Console.WriteLine(tsk1.Get(Tsk.Uid));
Console.WriteLine(tsk2.Get(Tsk.Uid));

Exactly what I was looking for. Thank you!

You are welcome.