NET Email Validation
ClearLog(String) Method
Example 






KellermanSoftware.NetEmailValidation Namespace > EmailValidation Class > ClearLog Method : ClearLog(String) Method
Clear the file log
Syntax
'Declaration
 
Public Overloads Function ClearLog( _
   ByVal filePath As System.String _
) As System.Boolean
'Usage
 
Dim instance As EmailValidation
Dim filePath As System.String
Dim value As System.Boolean
 
value = instance.ClearLog(filePath)
public System.bool ClearLog( 
   System.string filePath
)
public function ClearLog( 
    filePath: System.String
): System.Boolean; 
public function ClearLog( 
   filePath : System.String
) : System.boolean;
public: System.bool ClearLog( 
   System.string* filePath
) 
public:
System.bool ClearLog( 
   System.String^ filePath
) 

Parameters

filePath
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
Console.WriteLine(System.IO.File.ReadAllText(fileName));
 
//Clear the file
emailValidator.ClearLog(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
Console.WriteLine(System.IO.File.ReadAllText(fileName))
 
'Clear the file
emailValidator.ClearLog(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
Overload List