Beispiel #1
0
        private async void button2_Click(object sender, EventArgs e)
        {
            try
            {
                SynchronousSocketClient sok = new SynchronousSocketClient();
                string receive = await sok.SendData("loan " + ip + " " + user + " | " + book + " ");

                MessageBox.Show(receive);
                this.Close();
            }
            catch (Exception ex)
            {
            }
        }
Beispiel #2
0
        private async void button1_Click(object sender, EventArgs e)
        {
            if (SelectedUser != "")
            {
                SynchronousSocketClient ClientSoket = new SynchronousSocketClient();
                string data = await ClientSoket.SendData("return " + ip + " " + titlu + " | " + SelectedUser + " ");

                listView1.Clear();
                data = await ClientSoket.SendData("user " + ip + " " + titlu + " ");

                FillListView1(data);
            }
            else
            {
                MessageBox.Show("Nu a fost selectat nici un user!");
            }
        }
Beispiel #3
0
        public Form1()
        {
            InitializeComponent();
            filePath  = Utilities.GetPath();
            filePath += "\\croplog.gif";
            //textBox2.Text = "Parola";
            //this.BackgroundImage.Size.Width = this.Width;
            this.BackgroundImageLayout = ImageLayout.Stretch;
            this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true);
            label1.BackColor  = System.Drawing.Color.Transparent;
            label2.BackColor  = System.Drawing.Color.Transparent;
            ClientSoket       = new SynchronousSocketClient();
            listView1.Visible = false;
            listView2.Visible = false;
            // listView1.
            button2.Visible = false;
            button3.Visible = false;
            ColumnHeader h1, h2, h3;

            h1      = new ColumnHeader();
            h2      = new ColumnHeader();
            h3      = new ColumnHeader();
            h1.Text = "Index";
            h2.Text = "Nume";
            h3.Text = "CNP";
            listView1.Columns.AddRange(new ColumnHeader[] { h1, h2, h3 });
            listView1.View = View.Details;
            ColumnHeader s1, s2, s3;

            s1 = new ColumnHeader();
            s2 = new ColumnHeader();
            s3 = new ColumnHeader();

            s1.Text = "IBAN";
            s2.Text = "Autor";
            s3.Text = "Nume";
            listView2.Columns.AddRange(new ColumnHeader[] { s1, s2, s3 });
            listView2.View        = View.Details;
            textBox2.PasswordChar = '*';
            ip         = GetIP4Address();
            time       = new System.Windows.Forms.Timer();
            time.Tick += (sender, e) =>
            {
                Image a = gifImage.GetNextFrame();
                Image b = resizeImage(a, 50, 50);
                button1.Image = b;
                //button1.Image.Width = 20;
            };
            gifImage = new GifImage(filePath);
            gifImage.ReverseAtEnd = false;
            time.Enabled          = true;



            //test

            // myButtonObject myButton = new myButtonObject();
            // //EventHandler myHandler = new EventHandler(myButton_Click);
            //// myButton.Click += myHandler;
            // myButton.Location = new System.Drawing.Point(20, 20);
            // myButton.Size = new System.Drawing.Size(101, 101);
            // this.Controls.Add(myButton);
            // myButton.Visible = true;
            // myButton.BackColor = System.Drawing.Color.Transparent;
        }