如何在不使用 CreateUser 的情况下在 ASP.NET 成员资格表中创建用户
我想将用户和帖子从我正在使用的现有论坛迁移到 ASP.NET 成员资格表,而不使用 CreateUser。基本上我想维护用户ID,以便当我迁移帖子时它们继续与正确的用户关联。有没有办法做到这一点,或者我最好只使用 CreateUser,然后找到一种方法将 post-by UserID 重新分配给正确的新 ID?
谢谢
I want to migrate users and posts from an existing forum I am using to a ASP.NET membership table without using CreateUser. Basically I want to maintain userIDs so that when I migrate posts they continue to associate with the correct users. Is there a way to do this or would I be better off just using CreateUser and then finding a way to re-assign the post-by-UserIDs to the correct new IDs?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建一个 UserProfile 表,用于从 User 表连接到 Post 表。这将使您与 ASP.NET 成员资格提供程序的内部隔离,并且可以成为其他用户信息的扩展点。
这是我用来创建新用户及其配置文件的存储过程和关联函数:
You could create a UserProfile table that you can use to join from the User table to your Post table. This will insulate you from the ASP.NET Membership Provider's internals and can be an extension point for additional user information.
Here's a stored procedure and associated functions that I use to create new users and their profiles:
我要做的是在您的用户表和 ASP 会员资格表之间创建一个链接表,其中会员 ID(电子邮件地址?)将与 UserID(整数?)相关。然后,我将构建一个例程,用于以编程方式创建用户并使用用户数据填充成员资格表 - 通过 .NET 代码更容易做到这一点。
What I would do is I would create a link table between your user's table and ASP membership table where membership ID (email address?) would be related to UserID (Integer?). Then I would build a routine for creating users and populating membership table with users data programmatically - it is a little easier to do through .NET code.