Ejemplo n.º 1
0
        static bool AddUser(IList<string> unparsed)
        {
            if (unparsed.Count != 0)
            {
                Console.Error.WriteLine("Too many arguments for [add_user]: {0}", String.Join(", ", unparsed.Select(s => String.Format("'{0}'", s))));
                Console.Error.WriteLine("Usage: vmc add-user");
                return false;
            }

            Console.Write("Email: ");
            string email = Console.ReadLine();

            Console.Write("Password: "******"Verify Password: "******"Creating New User: "******"OK");
                return true;
            }
            else
            {
                Console.Error.WriteLine("Passwords did not match!");
                return false;
            }
        }
Ejemplo n.º 2
0
 public ProviderResponse<bool> RegisterAccount(string serverUrl, string email, string password)
 {
     var response = new ProviderResponse<bool>();
     try
     {
         IVcapClient client = new VcapClient(serverUrl);
         client.AddUser(email, password);
         response.Response = true;
     }
     catch (Exception ex)
     {
         response.Response = false;
         response.Message = ex.Message;
     }
     return response;
 }
Ejemplo n.º 3
0
 public ProviderResponse<bool> RegisterAccount(Cloud cloud,string email, string password)
 {
     var response = new ProviderResponse<bool>();
     try
     {
         IVcapClient client = new VcapClient(cloud);
         var vcapResult = client.AddUser(email,password);
         if (!vcapResult.Success)
             throw new Exception(vcapResult.Message);
         response.Response = true;
     }
     catch (Exception ex)
     {
         response.Message = ex.Message;
     }
     return response;
 }