Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/162.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ PST文件中的日历消息在哪里存储约会时间和日期?_C++_Visual C++_Outlook_Format_Pst - Fatal编程技术网

C++ PST文件中的日历消息在哪里存储约会时间和日期?

C++ PST文件中的日历消息在哪里存储约会时间和日期?,c++,visual-c++,outlook,format,pst,C++,Visual C++,Outlook,Format,Pst,我正在使用尝试从Outlook PST导出中提取一些约会项目数据: int main() { pst myfile(L"export.pst"); folder calendar = myfile.open_folder(L"Calendar"); for (folder::message_iterator msg = calendar.message_begin(); msg != calendar.message_end(); ++msg) {

我正在使用尝试从Outlook PST导出中提取一些约会项目数据:

int main()
{
    pst myfile(L"export.pst");
    folder calendar = myfile.open_folder(L"Calendar");
    for (folder::message_iterator msg = calendar.message_begin(); msg != calendar.message_end(); ++msg)
    {
        message m = *msg;
        wstring subject = L"";
        if (m.has_subject())
            subject = m.get_subject();
        wstring body = L"";
        if (m.has_body())
            body = m.get_body();
        wstring htmlbody = L"";
        if (m.has_html_body())
            htmlbody = m.get_html_body();
        size_t num_attachments = m.get_attachment_count();
        size_t num_recipients = m.get_recipient_count();
        property_bag bag = m.get_property_bag();
        vector<prop_id> propertyList = bag.get_prop_list();
        for (vector<prop_id>::iterator prop = propertyList.begin(); prop != propertyList.end(); ++prop)
        {
            if (bag.get_prop_type(*prop) == prop_type_systime)
                FILETIME property = bag.read_prop<FILETIME>(*prop);
        }
        break; // Just try the first message for now.
    }
    return 0;
}
intmain()
{
pst myfile(L“export.pst”);
文件夹日历=我的文件。打开文件夹(L“日历”);
对于(文件夹::message_iterator msg=calendar.message_begin();msg!=calendar.message_end();++msg)
{
消息m=*msg;
wstring subject=L“”;
如果(m.有_subject())
subject=m.get_subject();
wstring-body=L”“;
如果(m.有_body())
body=m.get_body();
wstring htmlbody=L”“;
if(m.具有\u html\u body())
htmlbody=m.get_html_body();
size_t num_attachments=m.get_attachment_count();
size_t num_recipients=m.get_recipient_count();
property_bag bag=m.get_property_bag();
vector propertyList=bag.get_prop_list();
对于(vector::iterator prop=propertyList.begin();prop!=propertyList.end();++prop)
{
if(行李获取道具类型(*prop)=道具类型系统时间)
FILETIME属性=行李读取属性(*prop);
}
break;//现在请尝试第一条消息。
}
返回0;
}
Outlook如何存储约会数据?我的意思是,我如何至少获得约会的开始时间和持续时间(或结束时间)?我一直在努力搜索,但我似乎找不到我需要的信息

编辑:我现在可以像上面的代码那样解析
FILETIME
对象,但问题是,我如何区分它们所指的时间?我的意思是,我怎么知道这是活动日期的时间,还是活动日期的结束,等等。?他们应该有名字来区分他们,不是吗?如何使用
pstsdk

这些(以及更多)属性存储为命名MAPI属性。它们的标签在不同的商店中会有所不同,因此您不能硬编码它们


查看中的现有约会(单击IMessage按钮)

谢谢,我将通过您的实用程序应用程序查看,但是这种类型的属性存储为什么数据类型?在上面的代码中,我遍历了消息属性列表-这与您所说的MAPI属性相同吗?因为我正在强制转换到
wstring
,它肯定会为所有其他非
wstring
的属性抛出异常,这使得我很难获得所需的数据。属性类型是PT\u SYSTIME。绝对不是字符串。好的,我设法使用
pstsdk
将属性放入
FILETIME
对象:
if(bag.get\u prop\u type(*prop)==prop\u type\u system time)FILETIME属性=bag.read\u prop(*prop)工作良好;我唯一不知道的是每个日期属性的名称,就像你说的那样,唯一地标识它?这个SDK有点奇怪,我不知道如何获取属性的名称。您需要查看属性标签。在MAPI级别上,命名属性(>=0x8000000,由OutlookSpy粗体显示)的属性标记(特定存储的唯一属性)通过调用IMAPIProp::GetIDsFromNames返回,并传递属性的GUID和id(使用OutlookSpy查看约会)。我不知道这些特定库如何处理命名属性。看起来这些属性实际上不是命名属性,而是包含一个GUID和一个ID,该GUID和ID映射到Exchange Server协议主属性列表中列出的特定属性。Microsoft在MS-OXPROPS文档中记录了每个GUID和ID映射到的内容:例如,
PidlidappointStartDate
,它标识约会开始的日期,对应于GUID
{00062002-0000-C000-0000000000-46}
和ID
0x00008212
,类型为
PtypTime