日期:2014-05-17 浏览次数:21341 次
private void button12_Click(object sender, EventArgs e)
{
string str = System.IO.File.ReadAllText("C:/Users/hp/Documents/Visual Studio 2010/Projects/homework3/homework3/Customer.txt");
Regex reg = new Regex(textBox4.Text);
Match m = reg.Match(str);
while (m.Success)
{
MessageBox.Show("Yes, you find it!",m.Index.ToString());
m = reg.Match(str, m.Index + m.Length);
}
}