public void Run()
        {
            //for each request, you need an SecurityToken and a Int64
            var cred = new ServiceUserPasswordCredentials();
            cred._login = "******";
            cred._passwordHash = "test".GetHashCode();
            SecToken = _GraphDS_Service.LogOn(cred);
            TransToken = _GraphDS_Service.BeginTransaction(SecToken);

            Stopwatch RunningTime = new Stopwatch();

            RunningTime.Start();

            #region Run Tasks

            Console.WriteLine("_________Generate DB Content:___________________________" + Environment.NewLine);
            GenerateDBContent();
            Console.Write(Environment.NewLine);

            Console.WriteLine("_________Gather some data out of the DB:________________" + Environment.NewLine);
            GatherData();
            Console.Write(Environment.NewLine);

            #endregion

            RunningTime.Stop();

            Console.WriteLine("________Example successful executed in " + RunningTime.ElapsedMilliseconds + " ms!______________"
                + Environment.NewLine + "Do you want to clear GraphDB? <y> | <n>");

            switch (Console.ReadLine())
            {
                case "y":
                    _GraphDS_Service.Clear(SecToken, TransToken);
                    Console.WriteLine("GraphDB successful cleared!");
                    break;
                default:
                    break;
            }

            Console.WriteLine("Press <Any Key> to end GraphDB Remote API Example!");
            Console.ReadLine();
        }
示例#2
0
 public SecurityToken LogOn(ServiceUserPasswordCredentials myUserCredentials)
 {
     return(this.GraphDS.LogOn(myUserCredentials));
 }
 /// <summary>
 /// Create new credentials
 /// </summary>
 /// <param name="myLogin">The login string</param>
 /// <param name="myPassword">The password</param>
 public RemoteUserPasswordCredentials(String myLogin, String myPassword)
 {
     _ServiceObject               = new ServiceUserPasswordCredentials();
     _ServiceObject._login        = myLogin;
     _ServiceObject._passwordHash = myPassword.GetHashCode();
 }
 /// <summary>
 /// Create new credentials
 /// </summary>
 /// <param name="myLogin">The login string</param>
 /// <param name="myPassword">The password</param>
 public RemoteUserPasswordCredentials(String myLogin, String myPassword)
 {
     _ServiceObject = new ServiceUserPasswordCredentials();
     _ServiceObject._login = myLogin;
     _ServiceObject._passwordHash = myPassword.GetHashCode();
 }