NET Email Validation
Cancel Property
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class : Cancel Property
Set to true to cancel asynchronous email validation
Syntax
'Declaration
 
Public Property Cancel As System.Boolean
'Usage
 
Dim instance As EmailValidation
Dim value As System.Boolean
 
instance.Cancel = value
 
value = instance.Cancel
public System.bool Cancel {get; set;}
public read-write property Cancel: System.Boolean; 
public function get,set Cancel : System.boolean
public: __property System.bool get_Cancel();
public: __property void set_Cancel( 
   System.bool value
);
public:
property System.bool Cancel {
   System.bool get();
   void set (    System.bool value);
}
Example
EmailValidation emailValidator = new EmailValidation(); //Trial Mode
//EmailValidation emailValidator = new EmailValidation("place user name here", "place license key here"); //License Mode
     
emailValidator.FromEmail = "someone@somewhere.com";
emailValidator.FromMailServer = "mail.somewhere.com";
 
//Create a list of 1000 email addresses
List<string> emailAddresses= new List<string>();
 
for (int i=1;i<=1000;i++)
    emailAddresses.Add(string.Format("johnsmith{0}@hotmail.com",i));
 
//Begin asynchronous validation
emailValidator.ValidateListAsync(emailAddresses);
 
while (emailValidator.IsBusy)
{
    //Cancel
    emailValidator.Cancel = true;
}
Dim emailValidator As EmailValidation = New EmailValidation() 'Trial Mode
'Dim emailValidator As EmailValidation = New EmailValidation("place user name here", "place license key here") 'License Mode
 
emailValidator.FromEmail = "someone@somewhere.com"
emailValidator.FromMailServer = "mail.somewhere.com"
 
'Create a list of 1000 email addresses
Dim emailAddresses As List(Of String)= New List(Of String)()
 
For i As Integer = 1 To 1000
    emailAddresses.Add(String.Format("johnsmith{0}@hotmail.com",i))
Next i
 
'Begin asynchronous validation
emailValidator.ValidateListAsync(emailAddresses)
 
Do While emailValidator.IsBusy
    'Cancel
    emailValidator.Cancel = True
Loop
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

EmailValidation Class
EmailValidation Members