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

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


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

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.

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