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; } }
static void Main() { Socket_.Load(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
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(); }
private void giveup_Click(object sender, EventArgs e) { Socket_.post("lose " + userName); }