CASA/CASA-auth-token/non-java/client/csharp/test/Class1.cs
Juan Carlos Luciani 214ec3603e Modified the folder name to follow the convention being followed for
test application folder names in the project.
2006-08-14 20:33:38 +00:00

47 lines
1.0 KiB
C#

using System;
using Novell.Casa.Client.Auth;
namespace TestClientAuth
{
/// <summary>
/// Summary description for Class1.
/// </summary>
class Class1
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Usage: TestClientAuth [server]");
Console.WriteLine("Press enter to continue");
Console.ReadLine();
return;
}
try
{
byte[] baToken = Authtoken.ObtainAuthToken("testService", args[0]);
Console.WriteLine("Token returned:");
for (int i=0; i<baToken.Length; i++)
{
Console.Write(baToken[i].ToString());
}
Console.WriteLine("");
Console.WriteLine("Press enter to continue");
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
Console.WriteLine("");
Console.WriteLine("Press enter to continue");
Console.ReadLine();
}
}
}
}