private void button2_Click(object sender, EventArgs e) { if (openFileDialog1.FileName == "openFileDialog1") { } else { operate.uploadImage(stuID, openFileDialog1); MessageBox.Show("上传成功", "成功", MessageBoxButtons.OK, MessageBoxIcon.Information); } }