- Description
- The following C# code shows how to retrieve a session id and use it to make calls to the TotalAgility SDK.
Please note that the corresponding App.Config file must be set up correctly for the methods to work. Please see here for more details.
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace UserLogOn
{
class Program
{
static void Main(string[] args)
{
id.UnconditionalLogOn = true;
id.LogOnProtocol = 7;
TotalAgility.Sdk.UserService userService = new TotalAgility.Sdk.UserService();
session2 = userService.LogOn2(id);
TotalAgility.Sdk.ResourceService resourceService = new TotalAgility.Sdk.ResourceService();
resourceId.
Name =
"User2";
bool userExists = resourceService.DoesResourceExist(session2.SessionId, resourceId);
userService.LogOff(session2.SessionId);
}
}
}