jmail 不能辨别新邮件
我初始化的时候读出上一次保存的UID,收到邮件时保存UID到文件中,并且比较这一次的邮件是否和保存的UID相同,相同的就不读出来,就是判断新邮件,现在完全没有反应,请赐教,底下是保存和读取UID的代码!O(∩_∩)O谢谢了if ((fp1 = fopen("d:\\topgun.txt", "r")) == NULL)
{
exit(0);
}
fread(DiskID, 15, 1, fp1);
fclose(fp1);
for(long i = 1; i <= lCount; i++)
{
char *a = pPOP3->GetMessageUID(i);
int alen = strlen(a);
pMessage = pMessages->Item[i];
custom1.bstrSubject = pMessage->Subject;
custom1.bstrFrom= pMessage->From;
custom1.bstrBody = pMessage->Body;
if(a!=DiskID)
{
printf("(%d)Subject:%s, From:%s, Body:%s\r\n", i, (const char*)custom1.bstrSubject , (constchar*) custom1.bstrFrom, (const char*)custom1.bstrBody); pMessage.Release();
}
FILE *fp;
if ((fp = fopen("d:\\topgun.txt", "ab+")) == NULL)
{
exit(0);
}
fwrite(a, sizeof(char), 1, fp);
fclose(fp);
}