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

C# Profile.ProfileInfoCollection类代码示例

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

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



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

示例1: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     if (profiles == null)
     {
         throw new ArgumentNullException("profiles");
     }
     if (profiles.Count < 1)
     {
         throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, ProviderResources.Parameter_collection_empty, new object[] { "profiles" }), "profiles");
     }
     int num = 0;
     using (MembershipContext context = ModelHelper.CreateMembershipContext(this.ConnectionString))
     {
         foreach (ProfileInfo info in profiles)
         {
             ProfileEntity entity = QueryHelper.GetProfile(context, this.ApplicationName, info.UserName);
             if (entity != null)
             {
                 num++;
                 context.Profiles.Remove(entity);
             }
         }
         context.SaveChanges();
     }
     return num;
 }
开发者ID:wyxy2005,项目名称:bluceNet,代码行数:26,代码来源:DefaultProfileProvider.cs


示例2: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     return DeleteProfiles(profiles
                             .Cast<ProfileInfo>()
                             .Select(profile => profile.UserName)
                             .ToArray());
 }
开发者ID:anktsrkr,项目名称:MongoMembership,代码行数:7,代码来源:MongoProfileProvider.cs


示例3: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     foreach (var prof in profiles)
     {
         NHibernateHelper.Delete(prof);
     }
     return profiles.Count;
 }
开发者ID:kyallbarrows,项目名称:LifeguardServer,代码行数:8,代码来源:NHibernateProfileProvider.cs


示例4: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     string[] usernames = new string[profiles.Count];
     int i = 0;
     foreach(ProfileInfo profile in profiles)
     {
         usernames[i++] = profile.UserName;
     }
     return DeleteProfiles(usernames);
 }
开发者ID:Jobu,项目名称:n2cms,代码行数:10,代码来源:ContentProfileProvider.cs


示例5: DeleteProfiles

        /// <summary>
        /// Deletes profile properties and information for the supplied list of profiles.
        /// </summary>
        /// <param name="profiles">A System.Web.Profile.ProfileInfoCollection of information about profiles that are to be deleted.</param>
        /// <returns>The number of profiles deleted from the data source.</returns>
        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            int deleteCount = 0;

            foreach (ProfileInfo p in profiles)
                if (DeleteProfile(p.UserName))
                    deleteCount++;

            return deleteCount;
        }
开发者ID:qq358292363,项目名称:showShop,代码行数:15,代码来源:YXShopProfileProvider.cs


示例6: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            List<string> userNames = new List<string>();
            foreach (ProfileInfo profile in profiles)
            {
                userNames.Add(profile.UserName);
            }

            return this.DeleteProfiles(userNames.Distinct<string>().ToArray<string>());
        }
开发者ID:pickup,项目名称:PickupBlog,代码行数:10,代码来源:SqlDbProfileProvider.cs


示例7: CreateEmptyCollection

        /// <summary>
        /// Erzeugt eine leere Auflistung für Benutzerprofile.
        /// </summary>
        /// <param name="totalRecords">Meldet die gesamte Anzahl von Einträgen.</param>
        /// <returns>Eine neue, leere Auflistung.</returns>
        private ProfileInfoCollection CreateEmptyCollection( out int totalRecords )
        {
            // Create collection
            var result = new ProfileInfoCollection();

            // None
            totalRecords = 0;

            // Finish
            return result;
        }
开发者ID:davinx,项目名称:DVB.NET---VCR.NET,代码行数:16,代码来源:UserProfileManager.cs


示例8: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            if (profiles == null) {
                throw TraceException("DeleteProfiles", new ArgumentNullException("profiles"));
            }
            if (profiles.Count == 0) {
                return 0;
            }

            return DeleteProfiles(profiles.Cast<ProfileInfo>().Select(p => p.UserName).ToArray());
        }
开发者ID:cdmckay,项目名称:mongodb-aspnet-providers,代码行数:11,代码来源:MongoProfileProvider.cs


示例9: FindProfilesByUserName

 public override ProfileInfoCollection FindProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, int pageIndex, int pageSize, out int totalRecords)
 {
     ProfileInfoCollection profiles = new ProfileInfoCollection();
     User u = Bridge.GetUser(usernameToMatch);
     if (u != null)
     {
         totalRecords = 1;
         if(pageIndex == 0 && pageSize > 0)
             profiles.Add(CreateProfile(u));
     }
     totalRecords = 0;
     return profiles;
 }
开发者ID:Jobu,项目名称:n2cms,代码行数:13,代码来源:ContentProfileProvider.cs


示例10: GetAllProfiles

 public override ProfileInfoCollection GetAllProfiles(ProfileAuthenticationOption authenticationOption, int pageIndex, int pageSize, out int totalRecords)
 {
     ProfileInfoCollection profiles = new ProfileInfoCollection();
     UserList users = Bridge.GetUserContainer(false);
     if (users != null)
     {
         totalRecords = users.Children.Count;
         foreach(User u in users.GetChildren(new Collections.CountFilter(pageIndex * pageSize, pageSize)))
             profiles.Add(CreateProfile(u));
     }
     totalRecords = 0;
     return profiles;
 }
开发者ID:grbbod,项目名称:drconnect-jungo,代码行数:13,代码来源:ContentProfileProvider.cs


示例11: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     var deleteCount = 0;
     try {
         deleteCount = profiles.Cast<ProfileInfo>().Count(p => DeleteProfile(p.UserName));
     } catch (Exception ex) {
         if (WriteExceptionsToEventLog) {
             WriteToEventLog(ex, "DeleteProfiles(ProfileInfoCollection)");
             throw new ProviderException(exceptionMessage);
         }
         throw;
     }
     return deleteCount;
 }
开发者ID:lgn,项目名称:CurrentProject,代码行数:14,代码来源:JsHProfileProvider.cs


示例12: DeleteProfiles

        /// <summary>
        /// When overridden in a derived class, deletes profile properties and information for the supplied list of profiles.
        /// </summary>
        /// <returns>The number of profiles deleted from the data source.</returns>
        /// <param name="profiles">A <see cref="T:System.Web.Profile.ProfileInfoCollection" />  of information about profiles that are to be deleted.</param>
        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            if (profiles == null)
            {
                throw new ArgumentNullException("profiles");
            }

            if (profiles.Count < 1)
            {
                throw new ArgumentException("profiles");
            }

            string[] usernames = profiles.Cast<ProfileInfo>().Select(p => p.UserName).ToArray();
            return DeleteProfiles(usernames);
        }
开发者ID:scottyinthematrix,项目名称:EFProviders-Model,代码行数:20,代码来源:EFProfileProvider.cs


示例13: DeleteProfiles

 public static int DeleteProfiles(ProfileInfoCollection profiles)
 {
     if (profiles == null)
     {
         throw new ArgumentNullException("profiles");
     }
     if (profiles.Count < 1)
     {
         throw new ArgumentException(System.Web.SR.GetString("Parameter_collection_empty", new object[] { "profiles" }), "profiles");
     }
     foreach (ProfileInfo info in profiles)
     {
         SecUtility.CheckParameter(ref info.UserName, true, true, true, 0, "UserName");
     }
     return Provider.DeleteProfiles(profiles);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:16,代码来源:ProfileManager.cs


示例14: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            Condition.Requires(profiles, "profiles").IsNotNull();

            int i;
            using (var db = this.ConnectToDatabase())
            {
                DeleteUserInRoles(db, profiles);
                DeleteOAuthMembership(db, profiles);
                DeleteMembership(db, profiles);
                i =
                    profiles.Cast<ProfileInfo>()
                            .Sum(profile => db.Execute(this.sqlQueryBuilder.DeleteProfile, profile.UserName));
            }

            return i;
        }
开发者ID:TheCodeKing,项目名称:BetterMembership.Net,代码行数:17,代码来源:BetterProfileProvider.cs


示例15: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {
            XElement perfilesXml = new XElement("Perfiles");
            foreach (ProfileInfo profileInfo in profiles)
            {
                perfilesXml.Add(new XElement("Perfil", new XAttribute("Login", profileInfo.UserName)));
            }

            SqlDatabase sqlDatabase = new SqlDatabase(_connectionString);
            DbCommand dbCommand = sqlDatabase.GetStoredProcCommand("adm.NlayerSP_EliminarPerfil");

            sqlDatabase.AddInParameter(dbCommand, "Aplicacion", DbType.String, _applicationName);
            sqlDatabase.AddInParameter(dbCommand, "Perfiles", DbType.Xml, perfilesXml.ToString());

            sqlDatabase.ExecuteNonQuery(dbCommand);

            return profiles.Count;
        }
开发者ID:JeyssonRamirez,项目名称:NLayer,代码行数:18,代码来源:NlayerProfileProvider.cs


示例16: DeleteProfiles

 public override int DeleteProfiles(ProfileInfoCollection profiles)
 {
     if (profiles == null)
     {
         throw new ArgumentNullException("profiles");
     }
     if (profiles.Count < 1)
     {
         throw new ArgumentException(System.Web.SR.GetString("Parameter_collection_empty", new object[] { "profiles" }), "profiles");
     }
     string[] usernames = new string[profiles.Count];
     int num = 0;
     foreach (ProfileInfo info in profiles)
     {
         usernames[num++] = info.UserName;
     }
     return this.DeleteProfiles(usernames);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:18,代码来源:SqlProfileProvider.cs


示例17: FindInactiveProfilesByUserName

        public override ProfileInfoCollection FindInactiveProfilesByUserName(ProfileAuthenticationOption authenticationOption, string usernameToMatch, DateTime userInactiveSinceDate, int pageIndex, int pageSize, out int totalRecords)
        {
            ProfileInfoCollection infos = new ProfileInfoCollection();
            try
            {
                User u = NHibernateProviderEntityHelper.GetUser(usernameToMatch);
                Profile prof = NHibernateProviderEntityHelper.GetProfile(usernameToMatch);

                infos.Add(new ProfileInfo(u.Name, this.isAnonymous(), u.LastActivityDate, prof.LastActivityDate, prof.PropertyNames.Length + prof.PropertyValuesBinary.Length + prof.PropertyValuesString.Length));
                totalRecords = 1;

            }
            catch (Exception ex)
            {
                throw ExceptionUtil.NewProviderException(this, "FindInactiveProfilesByUserName", ex);
            }
            return infos;
        }
开发者ID:kyallbarrows,项目名称:LifeguardServer,代码行数:18,代码来源:NHibernateProfileProvider.cs


示例18: DeleteProfiles

        public override int DeleteProfiles(ProfileInfoCollection profiles)
        {


            if (profiles.Count < 1)
            {
                ExceptionReporter.ThrowArgument("PROFILE", "PROFILESEMPTY");
            }

            string[] usernames = new string[profiles.Count];

            int index = 0;
            foreach (ProfileInfo profile in profiles)
            {
                usernames[index++] = profile.UserName;
            }

            return DeleteProfiles(usernames);
        }
开发者ID:vzrus,项目名称:VZF,代码行数:19,代码来源:ProfileProviderOverridenMethods.cs


示例19: DeleteProfiles

        //////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////
        //////////////////////////////////////////////////////////////////////
        public static int DeleteProfiles(ProfileInfoCollection profiles)
        {
            if( profiles == null )
            {
                throw new ArgumentNullException( "profiles" );
            }

            if ( profiles.Count < 1 )
            {
                throw new ArgumentException(
                    SR.GetString(SR.Parameter_collection_empty,
                        "profiles" ),
                    "profiles" );
            }

            foreach (ProfileInfo pi in profiles) {
                string username = pi.UserName;
                SecUtility.CheckParameter(ref username, true, true, true, 0, "UserName");
            }
            return Provider.DeleteProfiles(profiles);
        }
开发者ID:iskiselev,项目名称:JSIL.NetFramework,代码行数:24,代码来源:ProfileManager.cs


示例20: DeleteProfiles

		public override int DeleteProfiles (ProfileInfoCollection profiles)
		{
			if (profiles == null)
				throw new ArgumentNullException ("prfoles");
			if (profiles.Count == 0)
				throw new ArgumentException ("prfoles");

			string [] usernames = new string [profiles.Count];

			int i = 0;
			foreach (ProfileInfo pi in profiles) {
				if (pi.UserName == null)
					throw new ArgumentNullException ("element in profiles collection is null");

				if (pi.UserName.Length == 0 || pi.UserName.Length > 256 || pi.UserName.IndexOf (',') != -1)
					throw new ArgumentException ("element in profiles collection in illegal format");

				usernames [i++] = pi.UserName;
			}

			return DeleteProfilesInternal (usernames);
		}
开发者ID:nlhepler,项目名称:mono,代码行数:22,代码来源:SqlProfileProvider.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Razor.RazorEngineHost类代码示例发布时间:2022-05-26
下一篇:
C# TestCommon.CustomersModelWithInheritance类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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