Beispiel #1
0
        public Form2(string token)
        {
            InitializeComponent();
            ServicePointManager.ServerCertificateValidationCallback += (o, c, ch, er) => true;

            serviceClient = new ServiceReference1.ServiceClient();

            this.token = token;
            GetUsername();
            FillClientsTable();
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            ServiceReference1.ServiceClient client = new ServiceReference1.ServiceClient();
            try
            {
                string userToken = client.LoginWithAD(textBox1.Text, textBox2.Text);
                //label1.Text = string.Format("Welcome {0}", client.GetUsernameByToken(userToken));

                var form2 = new Form2(userToken);
                form2.Location      = this.Location;
                form2.StartPosition = FormStartPosition.Manual;
                form2.FormClosing  += delegate { this.Show(); };
                form2.Show();
                this.Hide();
            }
            catch (FaultException <ServiceReference1.ServiceFault> fault)
            {
                label1.Text = fault.Detail.Message;
            }
        }