所以我有这个代码
public partial class Form1 : Form
{
public string str;
public string str2;
public Form1()
{
InitializeComponent();
str = textBox1.Text;
str2 = textBox2.Text;
}
private void button1_Click(object sender, EventArgs e)
{
if (String.IsNullOrEmpty(textBox1.Text))
{
MessageBox.Show("Enter Material Name Please.");
}
if (str == str2)
{
MessageBox.Show("Materials are equal.");
}
else if (str != str2)
{
MessageBox.Show("Materials don't match.");
}
}
}
Run Code Online (Sandbox Code Playgroud)
我想你会猜到我在这里想做什么..你能说出它有什么问题吗?我几天前就开始了,原谅我缺乏知识.
c# ×1