请问我这个代码为什么会出现这样的提示:“检测道无法访问的代码”。。秋高手指点
using System;using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// public static string Usrname = "钟宇";
public static string Password = "asdf";
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if ((textBox1.Text.Trim().Length == 9))
{
textBox2.Focus();
}
}
public bool checkinput()
{
if (textBox1.Text.Trim().Length > 9 && textBox1.Text.Trim ().Length <= 6 )
{
MessageBox.Show("用户名不满足要求","提示");
return false;
}
if (textBox1.Text.Trim().Length < '0' || textBox1.Text.Trim().Length > '9')
{
MessageBox.Show("用户名格式错误。", "提示");
return false;
}
if (textBox1.Text == "")
{
MessageBox.Show("用户名格式错误。", "提示");
return false;
}
if (textBox2.Text == "")
{
MessageBox.Show("密码格式错误。", "提示");
return false;
}
//if ((textBox2.Text != asdf ))
//{
// MessageBox.Show("密码错误。", "提示");
// return false;
//}
if((textBox1 .Text.Trim ().Length == 9))
{
textBox2.Focus();
}
return true ;
Form2 an = new Form2();
an.ShowDialog();
}
// if (! checkinput(int))
// {
// return ;
// }
// else
//{
}
}