c# - Finding a domain name ending with worldpay.com or rbsworldpay.com from Dns.GetHostEntry -
can 1 please me find domain name ending worldpay.com or rbsworldpay.com
iphostentry entry = dns.gethostentry(givenip); var hostname = entry.hostname.tolower();
now want make sure hostname ends worldpay.com or rbsworldpay.com , things else want throw exception.
can 1 please help.
even regular expression check should do?
thanks
try code:
if(hostname.endswith("worldpay.com")||hostname.endswith("rbsworldpay.com") { throw new exception("wrong host"); }
it throw new exception when hostname
ends worldpay.com
or rbsworldpay.com
Comments
Post a Comment