CASA/CASA-auth-token/non-java/client/csharp/test/Class1.cs
2006-08-18 17:41:08 +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: ("+ baToken.Length + ")");
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();
}
}
}
}