BayesFilterSaveDatabase Method (String, String)
Saves the Bayesian database to disk.

Namespace: MailBee.AntiSpam
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public void SaveDatabase(
	string spamFilename,
	string nonSpamFilename
)

Parameters

spamFilename
Type: SystemString
The full or relative path to the file containing spam samples.
nonSpamFilename
Type: SystemString
The full or relative path to the file containing non-spam samples.
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionspamFilename or nonSpamFilename is an empty string or a null reference (Nothing in Visual Basic).
MailBeeIOExceptionAn I/O error occurred.
Remarks

This method always saves the database from memory to disk even if it has not been changed since it had been loaded with LoadDatabase(String, String) method. If you want to save the database only if it had been changed, use another SaveDatabase(String, String, Int32, Boolean) overload.

If you do not have a database yet, you should not call LoadDatabase(String, String). In this case, it's assumed the default empty database is loaded. You can then train it with TrainFilter(MailMessage, Boolean) method and then save the produced database to disk.

Make sure your application has read/write access to the specified database file locations.

Examples
The example is available in TrainFilter(MailMessage, Boolean) topic.
See Also