如何检查文本框是否包含“@ 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
}
答案 0 :(得分:1)
你可以这样做
if (email.text.Contains("@mediacollege.dk") )
{
// do your work
DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
DHFLodder.Insert(UserName.Text, 10);
}
else
{
// nothing
}