Beispiel #1
0
        private void Btn_GetHash_Click(object sender, EventArgs e)
        {
            if (Txb_ServerIp.Text == string.Empty)
            {
                MessageBox.Show("Please insert a server address!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Txb_Username.Text == string.Empty)
            {
                MessageBox.Show("Please insert a username!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (InputTextDialog inputTextDialog = new InputTextDialog("Get Passwordhash", "Password:", true))
            {
                DialogResult inputTextDialogResult = inputTextDialog.ShowDialog();
                if (inputTextDialogResult == DialogResult.OK)
                {
                    string password = inputTextDialog.UserText;
                    inputTextDialog.Dispose();

                    using (GetVersionAndHashDialog getHashDialog = new GetVersionAndHashDialog(Txb_ServerIp.Text, Convert.ToUInt32(Nud_port.Value), Cbox_UseSsl.Checked, Txb_Username.Text, password))
                    {
                        DialogResult hashDialogResult = getHashDialog.ShowDialog();
                        if (hashDialogResult == DialogResult.OK)
                        {
                            Mtxb_password.Text = getHashDialog.Hash;
                            ValidateMtxb(Mtxb_password);
                        }
                    }
                }
            }
        }
Beispiel #2
0
        private void Btn_Ok_Click(object sender, EventArgs e)
        {
            if (Txb_ServerIp.Text == string.Empty)
            {
                MessageBox.Show("Please insert a server address!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Txb_Username.Text == string.Empty)
            {
                MessageBox.Show("Please insert a username!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Mtxb_password.Text == string.Empty)
            {
                MessageBox.Show("Please insert a password hash!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (GetVersionAndHashDialog getHashDialog = new GetVersionAndHashDialog(Txb_ServerIp.Text, Convert.ToUInt32(Nud_port.Value), Cbox_UseSsl.Checked, Txb_Username.Text, Mtxb_password.Text, true, true))
            {
                DialogResult hashDialogResult = getHashDialog.ShowDialog();
                if (hashDialogResult == DialogResult.OK)
                {
                    if (!IsInEditMode)
                    {
                        ServerSettings server = new ServerSettings();
                        server.Address     = Txb_ServerIp.Text;
                        server.Port        = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl      = Cbox_UseSsl.Checked;
                        server.Username    = Txb_Username.Text;
                        server.Password    = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;

                        ReportGroup newGroup = new ReportGroup();
                        newGroup.GroupName = "My Group";

                        Settings.Instance.ServerSettings.Server.Add(server);
                        Settings.Instance.ServerSettings.Server[Settings.Instance.ServerSettings.Server.Count - 1].Groups.Add(newGroup);
                    }
                    else
                    {
                        ServerSettings server = Settings.Instance.ServerSettings.Server[EditId];
                        server.Address     = Txb_ServerIp.Text;
                        server.Port        = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl      = Cbox_UseSsl.Checked;
                        server.Username    = Txb_Username.Text;
                        server.Password    = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;
                    }
                    Settings.Instance.SaveSettings();
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #3
0
        private void Btn_Ok_Click(object sender, EventArgs e)
        {
            if (Txb_ServerIp.Text == string.Empty)
            {
                MessageBox.Show("Please insert a server address!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Txb_Username.Text == string.Empty)
            {
                MessageBox.Show("Please insert a username!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Mtxb_password.Text == string.Empty)
            {
                MessageBox.Show("Please insert a password hash!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (GetVersionAndHashDialog getHashDialog = new GetVersionAndHashDialog(Txb_ServerIp.Text, Convert.ToUInt32(Nud_port.Value), Cbox_UseSsl.Checked, Txb_Username.Text, Mtxb_password.Text, true, true))
            {
                DialogResult hashDialogResult = getHashDialog.ShowDialog();
                if (hashDialogResult == DialogResult.OK)
                {
                    if (!IsInEditMode)
                    {
                        ServerSettings server = new ServerSettings();
                        server.Address = Txb_ServerIp.Text;
                        server.Port = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl = Cbox_UseSsl.Checked;
                        server.Username = Txb_Username.Text;
                        server.Password = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;

                        ReportGroup newGroup = new ReportGroup();
                        newGroup.GroupName = "My Group";
                    
                        Settings.Instance.ServerSettings.Server.Add(server);
                        Settings.Instance.ServerSettings.Server[Settings.Instance.ServerSettings.Server.Count-1].Groups.Add(newGroup);
                    }
                    else
                    {
                        ServerSettings server = Settings.Instance.ServerSettings.Server[EditId];
                        server.Address = Txb_ServerIp.Text;
                        server.Port = Cbox_UseSsl.Checked ? 443 : (uint)Nud_port.Value;
                        server.UseSsl = Cbox_UseSsl.Checked;
                        server.Username = Txb_Username.Text;
                        server.Password = Mtxb_password.Text;
                        server.DisplayName = Txb_DisplayName.Text;
                    }
                    Settings.Instance.SaveSettings();
                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Beispiel #4
0
        private void Btn_GetHash_Click(object sender, EventArgs e)
        {
            if (Txb_ServerIp.Text == string.Empty)
            {
                MessageBox.Show("Please insert a server address!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            if (Txb_Username.Text == string.Empty)
            {
                MessageBox.Show("Please insert a username!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            using (InputTextDialog inputTextDialog = new InputTextDialog("Get Passwordhash", "Password:", true))
            {
                DialogResult inputTextDialogResult = inputTextDialog.ShowDialog();
                if (inputTextDialogResult == DialogResult.OK)
                {
                    string password = inputTextDialog.UserText;
                    inputTextDialog.Dispose();

                    using (GetVersionAndHashDialog getHashDialog = new GetVersionAndHashDialog(Txb_ServerIp.Text, Convert.ToUInt32(Nud_port.Value), Cbox_UseSsl.Checked, Txb_Username.Text, password))
                    {
                        DialogResult hashDialogResult = getHashDialog.ShowDialog();
                        if (hashDialogResult == DialogResult.OK)
                        {
                            Mtxb_password.Text = getHashDialog.Hash;
                            ValidateMtxb(Mtxb_password);
                        }
                    }
                }
            }
        }