System.Web.Security.Membership.Membership C# (CSharp) Method

Membership() static private method

static private Membership ( ) : System.Collections
return System.Collections
		static Membership ()
		{
			MembershipSection section = (MembershipSection) WebConfigurationManager.GetSection ("system.web/membership");

			providers = new MembershipProviderCollection ();

			ProvidersHelper.InstantiateProviders (section.Providers, providers, typeof (MembershipProvider));

			provider = providers[section.DefaultProvider];

			onlineTimeWindow = (int) section.UserIsOnlineTimeWindow.TotalMinutes;
			hashAlgorithmType = section.HashAlgorithmType;
			if (String.IsNullOrEmpty (hashAlgorithmType)) {
				MachineKeySection mks = WebConfigurationManager.GetSection ("system.web/machineKey") as MachineKeySection;
				MachineKeyValidationConverter cvt = new MachineKeyValidationConverter ();
				hashAlgorithmType = cvt.ConvertTo (null, null, mks.Validation, typeof (string)) as string;
			}
			
			if (String.IsNullOrEmpty (hashAlgorithmType))
				hashAlgorithmType = "SHA1";
		}