【问题标题】:ASP.NET Profiles - Add a profile to an existing userASP.NET 配置文件 - 向现有用户添加配置文件
【发布时间】:2009-08-15 22:15:06
【问题描述】:

如何向默认 SQL 配置文件和成员资格提供程序中的现有用户添加配置文件条目(由一个 guid、两个字符串和一个整数组成)?我可以通过 sql 查询或 C# 代码来做到这一点。

我需要将这些配置文件添加到现有用户。

【问题讨论】:

    标签: c# asp.net sql asp.net-membership profiles


    【解决方案1】:

    你可以使用ProfileBase的各种方法:

    var profile = ProfileBase.Create(username);
    profile.SetPropertyValue("MyGuid", aGuid);
    profile.SetPropertyValue("MyString", aString);
    // etc
    profile.Save()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-06-18
      • 1970-01-01
      • 1970-01-01
      • 2018-02-02
      • 1970-01-01
      • 1970-01-01
      • 2012-09-21
      相关资源
      最近更新 更多