Liest alle E-Mails aus dem Thunderbird Adressbuch.
Aufruf Beispiel:
List<string> listMails = new List<string>();
listMails = getMailsFromThunderbird(@"C:\Dokumente und Einstellungen\dein Anmeldename\Anwendungsdaten\Thunderbird\Profiles\dein Profil\abook.mab");
Das Snippet benötigt:
using System.IO;
public List<string> getMailsFromThunderbird(string strFullPathToAbook)
{
try
{
List<string> listMails = new List<string>();
string[] strLines = File.ReadAllLines(strFullPathToAbook);
foreach (string strLine in strLines)
{
if (strLine.Contains("@"))
{
int i = strLine.LastIndexOf("@");
for (int y = i; y >= 0; y--)
{
if (strLine.Substring(y, 1) == "=")
{
int intStartIndex = y;
for (int x = intStartIndex; x < strLine.Length; x++)
{
if (strLine.Substring(x, 1) == ")")
{
int intLength = x;
intStartIndex++;
listMails.Add(strLine.Substring(intStartIndex, intLength - intStartIndex));
x = strLine.Length;
y = -1;
}
}
}
}
}
}
return listMails;
}
catch (Exception ex)
{
// Mach etwas
return null;
}
}
Kommentare zum Snippet