0

如何检查文本框是否包含“@mediacollege.dk”

if (email.text == "here it checks if it contains "@mediacollege.dk" and does a command")
{
    DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
    DHFLodder.Insert(UserName.Text, 10);
}
else
{
    // nothing
}
4

1 回答 1

1

你可以这样做

if (email.text.Contains("@mediacollege.dk") )
 {
        // do your work
     DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
     DHFLodder.Insert(UserName.Text, 10);    
}
else
{
    // nothing
}
于 2012-08-30T17:14:15.213 回答