Please check the method's signature and ensure you are calling the correct overload.
The three string parameter overload is defined as:
public void CompressDirectory(
string directory, string archiveName,
string password)
Your code isn't providing a search pattern, it's setting a password of '*.txt'
Use one of the overloads that accepts a search pattern, eg:
public void CompressDirectory(
string directory, string archiveName,
string searchPattern, bool recursion)
or
public void CompressDirectory(
string directory, string archiveName,
string password = "", string searchPattern = "*", bool recursion = true)