NET Email Validation
DisableLogging Method
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class : DisableLogging Method
Disable all logging.
Syntax
'Declaration
 
Public Function DisableLogging() As System.Boolean
'Usage
 
Dim instance As EmailValidation
Dim value As System.Boolean
 
value = instance.DisableLogging()
public System.bool DisableLogging()
public function DisableLogging(): System.Boolean; 
public function DisableLogging() : System.boolean;
public: System.bool DisableLogging(); 
public:
System.bool DisableLogging(); 
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";
 
//Set up a file for logging
string fileName = "c:\\log.txt";
emailValidator.EnableLogging(fileName);
 
//Connect using the best available options
List<ValidationOptions> options = emailValidator.BestConnectionOptions();
Console.WriteLine(emailValidator.BestConnectionMessage);
 
//Validate a single email with the best available options
Result myResult = emailValidator.ValidEmail("john.smith@hotmail.com", options);
 
//Print the results to the console
string logText = System.IO.File.ReadAllText(fileName);
Console.WriteLine(logText);
 
//Disable Logging
emailValidator.DisableLogging();
 
myResult = emailValidator.ValidEmail("bob.smith@hotmail.com", options);
 
//Print the results to the console
Console.WriteLine(System.IO.File.ReadAllText(fileName));
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"
 
'Set up a file for logging
Dim fileName As String = "c:\log.txt"
emailValidator.EnableLogging(fileName)
 
'Connect using the best available options
Dim options As List(Of ValidationOptions) = emailValidator.BestConnectionOptions()
Console.WriteLine(emailValidator.BestConnectionMessage)
 
'Validate a single email with the best available options
Dim myResult As Result = emailValidator.ValidEmail("john.smith@hotmail.com", options)
 
'Print the results to the console
Dim logText As String = System.IO.File.ReadAllText(fileName)
Console.WriteLine(logText)
 
'Disable Logging
emailValidator.DisableLogging()
 
myResult = emailValidator.ValidEmail("bob.smith@hotmail.com", options)
 
'Print the results to the console
Console.WriteLine(System.IO.File.ReadAllText(fileName))
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