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
- OleDbTransaction.cs
- StatusBarDrawItemEvent.cs
- Transform.cs
- Transaction.cs
- MulticastNotSupportedException.cs
- ForceCopyBuildProvider.cs
- IpcChannel.cs
- PeerNameRecordCollection.cs
- ResourceContainer.cs
- PrivateUnsafeNativeCompoundFileMethods.cs
- TreeViewCancelEvent.cs
- CacheRequest.cs
- FileNotFoundException.cs
- XNodeNavigator.cs
- NavigationWindow.cs
- StringResourceManager.cs
- DbgUtil.cs
- Evidence.cs
- TitleStyle.cs
- DynamicQueryStringParameter.cs
- ContentType.cs
- XmlAnyElementAttributes.cs
- Wildcard.cs
- __Error.cs
- ProviderSettingsCollection.cs
- TextRangeAdaptor.cs
- CellCreator.cs
- SqlDeflator.cs
- DbCommandTree.cs
- InvariantComparer.cs
- MessageVersionConverter.cs
- EditingMode.cs
- DiagnosticTrace.cs
- GradientSpreadMethodValidation.cs
- CodeTypeParameterCollection.cs
- DetectEofStream.cs
- WebDisplayNameAttribute.cs
- Matrix3D.cs
- DeleteHelper.cs
- initElementDictionary.cs
- Int32CollectionValueSerializer.cs
- InvokeMethodActivity.cs
- SyntaxCheck.cs
- Image.cs
- AppDomainUnloadedException.cs
- XamlReader.cs
- LogicalExpressionTypeConverter.cs
- EntityConnectionStringBuilder.cs
- OrderPreservingPipeliningSpoolingTask.cs
- SqlIdentifier.cs
- EventManager.cs
- EntityKey.cs
- XmlImplementation.cs
- Int32AnimationBase.cs
- _SpnDictionary.cs
- BufferModeSettings.cs
- AlphaSortedEnumConverter.cs
- DockPanel.cs
- EventManager.cs
- FixedBufferAttribute.cs
- TextHidden.cs
- TextFormatter.cs
- SynchronizationLockException.cs
- CompositeScriptReferenceEventArgs.cs
- LinqDataSourceDisposeEventArgs.cs
- TableColumn.cs
- PanelStyle.cs
- FilterQuery.cs
- CrossAppDomainChannel.cs
- ContentHostHelper.cs
- PersistChildrenAttribute.cs
- ObjectParameter.cs
- GeneralTransform3D.cs
- MediaElementAutomationPeer.cs
- DetailsViewAutoFormat.cs
- CatalogPartDesigner.cs
- FilterEventArgs.cs
- CodeMethodInvokeExpression.cs
- BamlRecordWriter.cs
- FragmentQueryKB.cs
- SemanticKeyElement.cs
- SyndicationFeedFormatter.cs
- XmlNode.cs
- FontSource.cs
- InheritanceAttribute.cs
- Polyline.cs
- ComboBoxItem.cs
- ActivityTypeDesigner.xaml.cs
- PixelFormats.cs
- SessionEndingEventArgs.cs
- SafeNativeMethods.cs
- ProfileBuildProvider.cs
- HtmlInputRadioButton.cs
- TextCompositionManager.cs
- XmlCharacterData.cs
- listitem.cs
- QilName.cs
- AttributeQuery.cs
- DataGridParentRows.cs
- GenericParameterDataContract.cs