Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / Security / AuthenticationService.cs / 1 / AuthenticationService.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Security { using System.Web.ApplicationServices; using System.Web.Script.Services; using System.Web.Services; [ScriptService] internal sealed class AuthenticationService { [WebMethod] public bool Login(string userName, string password, bool createPersistentCookie) { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, true); // if(Membership.ValidateUser(userName, password)) { FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); return true; } return false; } [WebMethod] public void Logout() { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false); FormsAuthentication.SignOut(); } [WebMethod] public bool IsLoggedIn() { ApplicationServiceHelper.EnsureAuthenticationServiceEnabled(HttpContext.Current, false); return HttpContext.Current.Request.IsAuthenticated; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Stacktrace.cs
- TriggerActionCollection.cs
- CommandConverter.cs
- TextUtf8RawTextWriter.cs
- MetadataHelper.cs
- XmlUnspecifiedAttribute.cs
- RuleSetDialog.cs
- ImportedPolicyConversionContext.cs
- TargetControlTypeCache.cs
- ClosableStream.cs
- InvalidCommandTreeException.cs
- TimerEventSubscriptionCollection.cs
- DesignerActionUIService.cs
- SQLMoney.cs
- CurrencyManager.cs
- FixedSOMPageConstructor.cs
- ProcessProtocolHandler.cs
- MultiSelectRootGridEntry.cs
- MenuAdapter.cs
- TextEffect.cs
- InputReport.cs
- VectorAnimationBase.cs
- ComplexObject.cs
- ExpressionHelper.cs
- ImplicitInputBrush.cs
- TreeNodeCollectionEditor.cs
- SQLInt16Storage.cs
- securitycriticaldata.cs
- BulletedListEventArgs.cs
- CuspData.cs
- HelpProvider.cs
- WebAdminConfigurationHelper.cs
- TimeoutValidationAttribute.cs
- Membership.cs
- BookmarkManager.cs
- DataGridViewCellParsingEventArgs.cs
- ExecutedRoutedEventArgs.cs
- FontWeights.cs
- CorrelationRequestContext.cs
- FormatConvertedBitmap.cs
- Pool.cs
- FormsAuthenticationModule.cs
- XmlArrayItemAttributes.cs
- RelatedView.cs
- TableItemProviderWrapper.cs
- Substitution.cs
- SizeIndependentAnimationStorage.cs
- HtmlElementEventArgs.cs
- TextBoxView.cs
- MatrixTransform3D.cs
- KeyValuePair.cs
- PlaceHolder.cs
- DecoderFallbackWithFailureFlag.cs
- FontNamesConverter.cs
- UpnEndpointIdentity.cs
- ServiceSecurityContext.cs
- SafeUserTokenHandle.cs
- FollowerQueueCreator.cs
- CodeStatementCollection.cs
- ConstraintStruct.cs
- ProgressPage.cs
- LayoutInformation.cs
- DataBoundControlAdapter.cs
- UnionCodeGroup.cs
- XamlInt32CollectionSerializer.cs
- MexTcpBindingElement.cs
- IdentifierService.cs
- ModifierKeysConverter.cs
- WebEncodingValidator.cs
- LinkLabelLinkClickedEvent.cs
- WsdlContractConversionContext.cs
- TextSelectionProcessor.cs
- ChineseLunisolarCalendar.cs
- SecurityElement.cs
- VersionConverter.cs
- SortableBindingList.cs
- ClosableStream.cs
- KeyMatchBuilder.cs
- DataGridViewRowConverter.cs
- DecimalConverter.cs
- StrongNameMembershipCondition.cs
- ExpandCollapseProviderWrapper.cs
- DesignerVerbCollection.cs
- PropertyGridView.cs
- ObjectViewFactory.cs
- XPathNavigatorReader.cs
- GridItemPatternIdentifiers.cs
- SQLResource.cs
- sqlmetadatafactory.cs
- StreamGeometryContext.cs
- FlatButtonAppearance.cs
- FlowDocumentReader.cs
- CollectionsUtil.cs
- BitmapCacheBrush.cs
- DocumentViewerBaseAutomationPeer.cs
- HitTestParameters.cs
- RadioButton.cs
- CodeConditionStatement.cs
- VarRefManager.cs
- BasicViewGenerator.cs