Profile

  • 1316
  • 0

先在Web.Config中的輸入Profile標籤,即可在一般程式中直接使用。

Web.Config
<system.web>
<profiledefaultProvider="testProfileProvider">
     <properties>
           <addname="服務單位"type="System.String"/>
           <addname="中文姓名"type="System.String"/>
           <addname="聯絡電話"type="System.String"/>
      <groupname="使用者基本資料">
                <addname="Email"type="System.String"/>
                <addname="地址"type="System.String"/>
           </group>
     </properties>
</profile>
</system.web>
一般程式:
using System.Net;
    protected void Page_Load(object sender, EventArgs e)
    {
        this.lb_LoginID.Text = Page.User.Identity.Name.ToString();
        this.lb_LoginName.Text = Profile.中文姓名;
        this.lb_EMail.Text = Profile.使用者基本資料.Email;

Jenny:
    陽光令人愉快,雨水令人振作,
    風聲令人奮起,雪花令人興奮,
    沒有所謂的壞天氣!!
    只有不同的好天氣!!