Exemplo n.º 1
0
        private async void compileButton_ClickAsync(object sender, EventArgs e)
        {
            var nowLang = Convert.ToString(languege.SelectedIndex + 1);
            var source  = textBox1.Text;

            System.Windows.Forms.Application.DoEvents();
            var values = new Dictionary <string, string> {
                { "source", source }, { "qnum", qNum }, { "languege", nowLang }
            };
            var content = new FormUrlEncodedContent(values);

            var response = await client.PostAsync("http://114.202.56.161:5000", content);

            var responseString = await response.Content.ReadAsStringAsync();

            if (responseString.IndexOf("sucksex!!") >= 0)
            {
                compilerResultBox.Text = "컴파일 성공!";
                Socket_.post("win " + userName);
            }
            else if (compilerResultBox.Text.IndexOf("Fail") >= 0)
            {
                compilerResultBox.Text = "컴파일 실패";
            }
            else
            {
                compilerResultBox.Text = responseString;
            }
        }
Exemplo n.º 2
0
 static void Main()
 {
     Socket_.Load();
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
 }
Exemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            userName = textBox1.Text;
            Socket_.post("match " + userName);
            this.Visible = false;
            Form2 frm = new Form2(userName);

            frm.Show();
        }
Exemplo n.º 4
0
 private void giveup_Click(object sender, EventArgs e)
 {
     Socket_.post("lose " + userName);
 }