它嘗試登錄時出現此錯誤。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