• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UserProfileData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UserProfileData的典型用法代码示例。如果您正苦于以下问题:C# UserProfileData类的具体用法?C# UserProfileData怎么用?C# UserProfileData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UserProfileData类属于命名空间,在下文中一共展示了UserProfileData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Register

        public static bool Register(UserProfile userInfo, out string errorMsg)
        {
            errorMsg = "";
            UserProfile regInfo = new UserProfile()
            {
                UserName = userInfo.UserName,
                Password = SecurityHelper.Encrypt(userInfo.Password),
                RoleId=1//权限角色
            };
            int registerState;
            UserProfileData userPorfile=new UserProfileData();
            var userList=userPorfile.select(0," username ","username='"+regInfo.UserName+"'",null);
            bool  isNewName = true ;
            if (userList.Count > 0)
            {
                isNewName = false;
                errorMsg = "该用户名已注册";
                return isNewName;

            }
            try
            {
                registerState = userPorfile.insert(regInfo);
                if (registerState > 0)
                {
                    return true;
                }
                else return false;
            }
            catch (Exception ex)
            {
                errorMsg = "注册出错" + ex.ToString();
                return false;
            }
        }
开发者ID:PointName,项目名称:txl-solution,代码行数:35,代码来源:UserHelper.cs


示例2: AddTemporaryUserProfile

 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
 {
     //m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID);
     
     lock (m_profiles)
     {
         m_profiles[userProfile.ID] = userProfile;
     }
 }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:9,代码来源:TemporaryUserProfilePlugin.cs


示例3: AddTemporaryUserProfile

        public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
        {
            DumpStatus("AddTemporaryUserProfile(entry)"); 

            AddToProfileCache(userProfile);
            foreach (IUserDataPlugin plugin in m_plugins)
            {
                plugin.AddTemporaryUserProfile(userProfile);
            }
            DumpStatus("AddTemporaryUserProfile(exit)");
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:11,代码来源:UserManagerBase.cs


示例4: AddToCaches

        /// <summary>
        /// Update an existing profile
        /// </summary>
        /// <param name="userProfile"></param>
        /// <returns>true if a user profile was found to update, false otherwise</returns>
        // Commented out for now.  The implementation needs to be improved by protecting against race conditions,
        // probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via
        // returning a read only class from the cache).
//        public bool StoreProfile(UserProfileData userProfile)
//        {
//            lock (m_userProfilesById)
//            {
//                CachedUserInfo userInfo = GetUserDetails(userProfile.ID);
//
//                if (userInfo != null)
//                {
//                    userInfo.m_userProfile = userProfile;
//                    m_commsManager.UserService.UpdateUserProfile(userProfile);
//
//                    return true;
//                }
//            }
//
//            return false;
//        }
        
        /// <summary>
        /// Populate caches with the given user profile
        /// </summary>
        /// <param name="userProfile"></param>
        protected CachedUserInfo AddToCaches(UserProfileData userProfile)
        {
            CachedUserInfo createdUserInfo = new CachedUserInfo(m_InventoryService, userProfile);
            
            lock (m_userProfilesById)
            {
                m_userProfilesById[createdUserInfo.UserProfile.ID] = createdUserInfo;
                
                lock (m_userProfilesByName)
                {
                    m_userProfilesByName[createdUserInfo.UserProfile.Name] = createdUserInfo;
                }
            }
            
            return createdUserInfo;
        }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:46,代码来源:UserProfileCacheService.cs


示例5: UpdateUserProfile

 public bool UpdateUserProfile(UserProfileData user) { return false; }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:1,代码来源:TemporaryUserProfilePlugin.cs


示例6: AddUser

        /// <summary>
        /// Add a new user
        /// </summary>
        /// <param name="firstName">first name</param>
        /// <param name="lastName">last name</param>
        /// <param name="password">password</param>
        /// <param name="email">email</param>
        /// <param name="regX">location X</param>
        /// <param name="regY">location Y</param>
        /// <param name="uuid">UUID of avatar.</param>
        /// <returns>The UUID of the created user profile.  On failure, returns UUID.Zero</returns>
        public virtual UUID AddUser(
            string firstName, string lastName, string password, string email, uint regX, uint regY, UUID uuid)
        {
            string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);

            UserProfileData userProf = GetUserProfile(firstName, lastName);
            if (userProf != null)
            {
                m_log.Error("[USERSTORAGE]: Not creating user. User already exists ");
                return UUID.Zero;
            }

            UserProfileData user = new UserProfileData();
            user.HomeLocation = new Vector3(128, 128, 100);
            user.ID = uuid;
            user.FirstName = firstName;
            user.SurName = lastName;
            user.PasswordHash = md5PasswdHash;
            user.PasswordSalt = String.Empty;
            user.Created = Util.UnixTimeSinceEpoch();
            user.HomeLookAt = new Vector3(100, 100, 100);
            user.HomeRegionX = regX;
            user.HomeRegionY = regY;
            user.Email = email;

            m_storage.AddUser(user);

            userProf = GetUserProfile(uuid);
            if (userProf == null)
            {
                return UUID.Zero;
            }
            else
            {
                CreateInventorySkel(userProf);
                return userProf.ID;
            }
        }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:49,代码来源:UserProfileManager.cs


示例7: CreateAgent

        public void CreateAgent(UserProfileData profile, OSD request)
        {
            //m_log.DebugFormat("[USER CACHE]: Creating agent {0} {1}", profile.Name, profile.ID);
            
            UserAgentData agent = new UserAgentData();

            // User connection
            agent.AgentOnline = true;

            //if (request.Params.Count > 1)
            //{
            //    IPEndPoint RemoteIPEndPoint = (IPEndPoint)request.Params[1];
            //    agent.AgentIP = RemoteIPEndPoint.Address.ToString();
            //    agent.AgentPort = (uint)RemoteIPEndPoint.Port;
            //}

            // Generate sessions
            RNGCryptoServiceProvider rand = new RNGCryptoServiceProvider();
            byte[] randDataS = new byte[16];
            byte[] randDataSS = new byte[16];
            rand.GetBytes(randDataS);
            rand.GetBytes(randDataSS);

            agent.SecureSessionID = new UUID(randDataSS, 0);
            agent.SessionID = new UUID(randDataS, 0);

            // Profile UUID
            agent.ProfileID = profile.ID;

            // Current location/position/alignment
            if (profile.CurrentAgent != null)
            {
                agent.Region = profile.CurrentAgent.Region;
                agent.Handle = profile.CurrentAgent.Handle;
                agent.Position = profile.CurrentAgent.Position;
                agent.LookAt = profile.CurrentAgent.LookAt;
            }
            else
            {
                agent.Region = profile.HomeRegionID;
                agent.Handle = profile.HomeRegion;
                agent.Position = profile.HomeLocation;
                agent.LookAt = profile.HomeLookAt;
            }

            // What time did the user login?
            agent.LoginTime = Util.UnixTimeSinceEpoch();
            agent.LogoutTime = 0;

            profile.CurrentAgent = agent;
        }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:51,代码来源:UserProfileManager.cs


示例8: UpdateUserProfile

 public virtual bool UpdateUserProfile(UserProfileData profile)
 {
     ReplaceUserData(profile);
     return m_storage.UpdateUserProfileData(profile);
 }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:5,代码来源:UserProfileManager.cs


示例9: CommitAgent

 /// <summary>
 /// Saves a target agent to the database
 /// </summary>
 /// <param name="profile">The users profile</param>
 /// <returns>Successful?</returns>
 public bool CommitAgent(ref UserProfileData profile)
 {
     //m_log.DebugFormat("[USER MANAGER]: Committing agent {0} {1}", profile.Name, profile.ID);
     
     // TODO: how is this function different from setUserProfile?  -> Add AddUserAgent() here and commit both tables "users" and "agents"
     // TODO: what is the logic should be?
     bool ret = false;
     ret = AddUserAgent(profile.CurrentAgent);
     ret = ret & UpdateUserProfile(profile);
     return ret;
 }
开发者ID:Ideia-Boa,项目名称:Diva-s-OpenSim-Tests,代码行数:16,代码来源:UserManagerBase.cs


示例10: UpdateUserProfile

 public virtual bool UpdateUserProfile(UserProfileData data)
 {
     bool result = false;
     
     foreach (IUserDataPlugin plugin in m_plugins)
     {
         try
         {
             plugin.UpdateUserProfile(data);
             result = true;
         }
         catch (Exception e)
         {
             m_log.ErrorFormat(
                 "[USERSTORAGE]: Unable to set user {0} {1} via {2}: {3}", 
                 data.FirstName, data.SurName, plugin.Name, e.ToString());
         }
     }
     
     return result;
 }
开发者ID:Ideia-Boa,项目名称:Diva-s-OpenSim-Tests,代码行数:21,代码来源:UserManagerBase.cs


示例11: UpdateUserProfileData

        public virtual bool UpdateUserProfileData(UserProfileData profile)
        {
            m_log.DebugFormat("[USERSTORAGE]: UpdateUserProfileData plugin request for {0} {1}", profile.ID, profile.Name);
            bool result = false;

            foreach (IUserDataPlugin plugin in m_plugins)
            {
                try
                {
                    plugin.UpdateUserProfile(profile);
                    result = true;
                }
                catch (Exception e)
                {
                    m_log.ErrorFormat(
                        "[USERSTORAGE]: Unable to set user {0} {1} via {2}: {3}", 
                        profile.FirstName, profile.SurName, plugin.Name, e.ToString());
                }
            }
            
            return result;
        }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:22,代码来源:UserProfileManagerData.cs


示例12: AddUser

 public void AddUser(UserProfileData profile)
 {
     m_log.DebugFormat("[USERSTORAGE]: AddUser plugin request for {0} {1}", profile.ID, profile.Name);
     foreach (IUserDataPlugin plugin in m_plugins)
     {
         try
         {
             plugin.AddNewUserProfile(profile);
         }
         catch (Exception e)
         {
             m_log.Error("[USERSTORAGE]: Unable to add user via " + plugin.Name + "(" + e.ToString() + ")");
         }
     }
 }
开发者ID:digitalmystic,项目名称:halcyon,代码行数:15,代码来源:UserProfileManagerData.cs


示例13: AddUser

        /// <summary>
        /// Add a new user
        /// </summary>
        /// <param name="firstName">first name</param>
        /// <param name="lastName">last name</param>
        /// <param name="password">password</param>
        /// <param name="email">email</param>
        /// <param name="regX">location X</param>
        /// <param name="regY">location Y</param>
        /// <param name="SetUUID">UUID of avatar.</param>
        /// <returns>The UUID of the created user profile.  On failure, returns UUID.Zero</returns>
        public virtual UUID AddUser(
            string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID)
        {
            string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);

            UserProfileData userProf = GetUserProfile(firstName, lastName);
            if (userProf != null)
            {
                m_log.Error("[USERSTORAGE]: Not creating user. User already exists ");
                return UUID.Zero;
            }

            UserProfileData user = new UserProfileData();
            user.HomeLocation = new Vector3(128, 128, 100);
            user.ID = SetUUID;
            user.FirstName = firstName;
            user.SurName = lastName;
            user.PasswordHash = md5PasswdHash;
            user.PasswordSalt = String.Empty;
            user.Created = Util.UnixTimeSinceEpoch();
            user.HomeLookAt = new Vector3(100, 100, 100);
            user.HomeRegionX = regX;
            user.HomeRegionY = regY;
            user.Email = email;

            foreach (IUserDataPlugin plugin in m_plugins)
            {
                try
                {
                    plugin.AddNewUserProfile(user);
                }
                catch (Exception e)
                {
                    m_log.Error("[USERSTORAGE]: Unable to add user via " + plugin.Name + "(" + e.ToString() + ")");
                }
            }

            userProf = GetUserProfile(firstName, lastName);
            if (userProf == null)
            {
                return UUID.Zero;
            }
            else
            {
                CreateInventorySkel(userProf);
                return userProf.ID;
            }
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:59,代码来源:UserManagerBase.cs


示例14: UpdateUserProfile

        public virtual bool UpdateUserProfile(UserProfileData profile)
        {
            bool result = false;

            lock (_userProfilesLock)
            {
                _cachedProfileData.Remove(profile.ID);
            }
            
            foreach (IUserDataPlugin plugin in m_plugins)
            {
                try
                {
                    plugin.UpdateUserProfile(profile);
                    result = true;
                }
                catch (Exception e)
                {
                    m_log.ErrorFormat(
                        "[USERSTORAGE]: Unable to set user {0} {1} via {2}: {3}", 
                        profile.FirstName, profile.SurName, plugin.Name, e.ToString());
                }
            }
            
            return result;
        }
开发者ID:BogusCurry,项目名称:halcyon,代码行数:26,代码来源:UserManagerBase.cs


示例15: NewCachedUserInfo

        /// <summary>
        /// Upgrade a UserProfileData to a CachedUserInfo.
        /// </summary>
        /// <param name="userProfile"></param>
        /// <param name="friends">friends can be null when called from the User grid server itself.</param>
        /// <returns></returns>
        protected CachedUserInfo NewCachedUserInfo(UserProfileData userProfile, List<FriendListItem> friends)
        {
//            if ((friends == null) && (m_commsManager.UserService != null))
//                friends = m_commsManager.UserService.GetUserFriendList(userProfile.ID);
            return new CachedUserInfo(m_commsManager, userProfile, friends);
        }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:12,代码来源:UserProfileManager.cs


示例16: AddToUserInfoCache

        /// <summary>
        /// Populate caches with the given user profile (allocate userInfo).
        /// </summary>
        /// <param name="profile"></param>
        protected CachedUserInfo AddToUserInfoCache(UserProfileData profile)
        {
            CachedUserInfo userInfo = NewCachedUserInfo(profile, null);

            AddToUserInfoCache(userInfo);
            return userInfo;
        }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:11,代码来源:UserProfileManager.cs


示例17: AddUser

        /// <summary>
        /// Add a new user
        /// </summary>
        /// <param name="firstName">first name</param>
        /// <param name="lastName">last name</param>
        /// <param name="password">password</param>
        /// <param name="email">email</param>
        /// <param name="regX">location X</param>
        /// <param name="regY">location Y</param>
        /// <param name="SetUUID">UUID of avatar.</param>
        /// <returns>The UUID of the created user profile.  On failure, returns UUID.Zero</returns>
        public virtual UUID AddUser(
            string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID)
        {
            string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty);

            UserProfileData user = new UserProfileData();
            user.HomeLocation = new Vector3(128, 128, 100);
            user.ID = SetUUID;
            user.FirstName = firstName;
            user.SurName = lastName;
            user.PasswordHash = md5PasswdHash;
            user.PasswordSalt = String.Empty;
            user.Created = Util.UnixTimeSinceEpoch();
            user.HomeLookAt = new Vector3(100, 100, 100);
            user.HomeRegionX = regX;
            user.HomeRegionY = regY;
            user.Email = email;

            foreach (IUserDataPlugin plugin in m_plugins)
            {
                try
                {
                    plugin.AddNewUserProfile(user);
                }
                catch (Exception e)
                {
                    m_log.Error("[USERSTORAGE]: Unable to add user via " + plugin.Name + "(" + e.ToString() + ")");
                }
            }

            UserProfileData userProf = GetUserProfile(firstName, lastName);
            if (userProf == null)
            {
                return UUID.Zero;
            }
            else
            {
                //
                // WARNING: This is a horrible hack
                // The purpose here is to avoid touching the user server at this point.
                // There are dragons there that I can't deal with right now.
                // diva 06/09/09
                //
                if (m_InventoryService != null)
                {
                    // local service (standalone)
                    m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory");
                    m_InventoryService.CreateUserInventory(userProf.ID);
                    InventoryFolderBase rootfolder = m_InventoryService.GetRootFolder(userProf.ID);
                    if (rootfolder != null)
                        userProf.RootInventoryFolderID = rootfolder.ID;
                }
                else if (m_commsManager.InterServiceInventoryService != null)
                {
                    // used by the user server
                    m_log.Debug("[USERSTORAGE]: using m_commsManager.InterServiceInventoryService to create user's inventory");
                    m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID);
                }

                return userProf.ID;
            }
        }
开发者ID:Ideia-Boa,项目名称:Diva-s-OpenSim-Tests,代码行数:73,代码来源:UserManagerBase.cs


示例18: AddTemporaryUserProfile

        /// <summary>
        /// Temporary profiles are used for bot users, they have no persistence.
        /// </summary>
        /// <param name="userProfile">the bot user profile</param>
        public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
        {
            AddToUserInfoCache(userProfile);

            lock (m_userDataLock)
            {
                if (m_tempDataByUUID.ContainsKey(userProfile.ID))
                    m_tempDataByUUID.Remove(userProfile.ID);
                m_tempDataByUUID.Add(userProfile.ID, userProfile);

                if (m_userDataByName.ContainsKey(userProfile.Name))
                    m_userDataByName.Remove(userProfile.Name);
                m_userDataByName.Add(userProfile.Name, userProfile);
            }
        }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:19,代码来源:UserProfileManager.cs


示例19: AddTemporaryUserProfile

 public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
 {
     foreach (IUserDataPlugin plugin in m_plugins)
     {
         plugin.AddTemporaryUserProfile(userProfile);
     }
 }
开发者ID:Ideia-Boa,项目名称:Diva-s-OpenSim-Tests,代码行数:7,代码来源:UserManagerBase.cs


示例20: CommitAgent

        /// <summary>
        /// Saves a target agent to the database
        /// </summary>
        /// <param name="profile">The users profile</param>
        /// <returns>Successful?</returns>
        public bool CommitAgent(ref UserProfileData profile)
        {
//            if (m_isUserServer) m_log.WarnFormat("[USER CACHE]: CommitAgent: {0} {1}", profile.ID, profile.CurrentAgent.SecureSessionID);

            // TODO: how is this function different from setUserProfile?  -> Add AddUserAgent() here and commit both tables "users" and "agents"
            // TODO: what is the logic should be?
            bool ret = false;
            ret = AddUserAgent(profile.CurrentAgent);
            ret = ret & UpdateUserProfile(profile);
            return ret;
        }
开发者ID:Fred2008Levasseur,项目名称:halcyon,代码行数:16,代码来源:UserProfileManager.cs



注:本文中的UserProfileData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UserRepository类代码示例发布时间:2022-05-24
下一篇:
C# UserProfile类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap