如何从ContactInformation获得姓氏和名字吗?姓氏、名字、ContactInformation

2023-09-04 03:49:56 作者:落落清欢

我使用在Windows Store应用程序的 ContactPicker ,我需要检索的第一个名字和姓氏分别为选定的联系人。不幸的是, ContactInformation 类只有一个名称属性,其中名字的两个部分都连接在一起。该 CustomFields 属性为空。

I'm using the ContactPicker in a Windows Store application, and I need to retrieve the first name and last name separately for the selected contact. Unfortunately, the ContactInformation class only has a Name property, where both parts of the name are concatenated. The CustomFields property is empty.

我觉得很难相信,有没有办法访问的第一个名字和姓氏,因为它们被分别存储在联系人应用程序...

I find it hard to believe that there is no way to access the first name and last name, since they are stored separately in the Contacts application...

你知道吗?

推荐答案

ContactInformation 类已经pcated在Windows 8.1代$ P $,并替换为 联系方式 类,它提供了更详细的信息,包括名字和姓氏。

The ContactInformation class has been deprecated in Windows 8.1, and replaced by the Contact class, which provides more detailed information, including first and last name.

编辑:其实,这也不行;将名字属性包含串联姓氏和名字,以及姓氏属性是空的......不知道这是在ContactPicker API或联系人应用程序中的错误。

actually, this doesn't work; the FirstName property contains the concatenated first and last name, and the LastName property is empty... Not sure if this is a bug in the ContactPicker API or in the Contacts app.