CASA/CASA-auth-token/non-java/client/csharp/test/Class1.cs

47 lines
1.0 KiB
C#
Raw Normal View History

2006-08-14 16:16:57 +02:00
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]);
2006-08-18 19:41:08 +02:00
Console.WriteLine("Token returned: ("+ baToken.Length + ")");
2006-08-14 16:16:57 +02:00
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();
}
}
}
}