diff --git a/TGS.Interface/RemoteLoginInfo.cs b/TGS.Interface/RemoteLoginInfo.cs index c161a124cb..06568fbe6d 100644 --- a/TGS.Interface/RemoteLoginInfo.cs +++ b/TGS.Interface/RemoteLoginInfo.cs @@ -20,6 +20,11 @@ namespace TGS.Interface /// A Windows username for the target server /// public string Username { get; } + /// + /// Check if the has been initialized with a + /// + public bool HasPassword { get { return !String.IsNullOrWhiteSpace(Password); } } + /// /// The Windows password for /// @@ -51,8 +56,14 @@ namespace TGS.Interface /// The value for public RemoteLoginInfo(string ip, ushort port, string username, string password) { + if (String.IsNullOrWhiteSpace(ip)) + throw new InvalidOperationException("ip must be set!"); _ip = ip; + if(port == 0) + throw new InvalidOperationException("port may not be 0!"); _port = port; + if (String.IsNullOrWhiteSpace(username)) + throw new InvalidOperationException("username must be set!"); _username = username; _password = password; } diff --git a/TGS.Interface/ServerInterface.cs b/TGS.Interface/ServerInterface.cs index 3fa5c99bb9..fcb7852243 100644 --- a/TGS.Interface/ServerInterface.cs +++ b/TGS.Interface/ServerInterface.cs @@ -216,6 +216,8 @@ namespace TGS.Interface /// The for a remote connection public ServerInterface(RemoteLoginInfo loginInfo) { + if (!loginInfo.HasPassword) + throw new InvalidOperationException("password must be set on loginInfo!"); _loginInfo = loginInfo; }