Share via


SyndicationPerson.Email 屬性

定義

取得或設定 SyndicationPerson 的電子郵件地址。

public:
 property System::String ^ Email { System::String ^ get(); void set(System::String ^ value); };
public string Email { get; set; }
member this.Email : string with get, set
Public Property Email As String

屬性值

人員的電子郵件地址。

範例

下列程式碼會示範如何設定 SyndicationPerson 執行個體的電子郵件地址。

SyndicationPerson sp = new SyndicationPerson();
sp.Email = "jesper@contoso.com";
Dim sp As New SyndicationPerson()
sp.Email = "jesper@contoso.com"

下列 XML 顯示 Email 如何序列化為 Atom 1.0。

<author>
  <name>Jesper Aaberg</name>
  <uri>http://Jesper/Aaberg</uri>
  <email>Jesper.Aaberg@contoso.com</email>
</author>
<contributor>
  <name>Lene Aalling</name>
  <uri>http://Lene/Aaling</uri>
  <email>Lene.Aaling@contoso.com</email>
</contributor>

下列 XML 顯示 Email 如何序列化為 RSS 2.0。

<a10:author>
  <a10:name>Lene Aalling</a10:name>
  <a10:uri>http://Lene/Aalling</a10:uri>
  <a10:email>Lene.Aalling@contoso.com</a10:email>
</a10:author>
  <a10:contributor>
  <a10:name>Jesper Aaberg</a10:name>
  <a10:uri>http://Jesper/Aaberg</a10:uri>
  <a10:email>Jesper.Aaberg@contoso.com</a10:email>
</a10:contributor>

備註

序列化為 Atom 1.0 時,會將 SyndicationPerson 屬性做為 <email> 項目寫入。 <email> 項目可能出現在 <author><contributor> 項目內,視 SyndicationPerson 新增至哪一個集合 (作者或參與者) 而定。

序列化為 RSS 2.0 時,會將此值做為 <a10:email> 項目寫入。 <a10:email> 項目可能會出現在 <managingEditor><a10:author><a10:contributor> 項目內。 如果只新增一個 SyndicationPerson 至作者集合中,<email> 項目會寫入至 <managingEditor> 項目中。 如果新增一個以上的 SyndicationPerson 至作者集合中,<email> 項目會寫入至 <a10:author> 項目中。 如果新增 SyndicationPerson 至參與者集合中,<email> 項目會寫入至 <a10:contributor> 項目中。

適用於