在文本框中选择一些文本

时间:2022-03-22 00:59:22

How do I check if a textbox contains "@mediacollege.dk" in like this

如何检查文本框是否包含“@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
}

1 个解决方案

#1


1  

You can do it as

你可以这样做

if (email.text.Contains("@mediacollege.dk") )
 {
        // do your work
     DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
     DHFLodder.Insert(UserName.Text, 10);    
}
else
{
    // nothing
}

#1


1  

You can do it as

你可以这样做

if (email.text.Contains("@mediacollege.dk") )
 {
        // do your work
     DHF_LodderTableAdapter DHFLodder = new DHF_LodderTableAdapter();
     DHFLodder.Insert(UserName.Text, 10);    
}
else
{
    // nothing
}