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"); // TODO usage statement standardization 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); } }
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"); // TODO usage statement standardization 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; } }
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); }
public ProviderResponse <bool> RegisterAccount(Cloud cloud, string email, string password) { ProviderResponse <bool> 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); }
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; }