它尝试登录时出现此错误。C# - 基于零的字符串错误
索引(基于零)必须大于或等于零并小于参数列表的大小。
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//string name = textBox1.Text;
string.Format ("{0} {1}", "Best", "Regards");
if (textBox1.Text == "Ryan" && textBox2.Text == "password")
{
MessageBox.Show(string.Format("Welcome {1}"));
}
}
}
@tnw真是说 – Freelancer 2013-04-30 12:47:17
对不起,你是对的。我自己标记了它。 – 2013-04-30 14:12:41