Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Security / AuthenticationService.cs / 1305376 / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- InputLanguageSource.cs
- EmptyStringExpandableObjectConverter.cs
- XmlSchemaObjectCollection.cs
- PriorityQueue.cs
- TypeToken.cs
- CacheMode.cs
- ToolStripButton.cs
- NavigationHelper.cs
- SystemIcons.cs
- PolicyStatement.cs
- BaseServiceProvider.cs
- FixedPageProcessor.cs
- MonitorWrapper.cs
- GenericsNotImplementedException.cs
- versioninfo.cs
- OutputWindow.cs
- FileDialog_Vista_Interop.cs
- ExtendedPropertiesHandler.cs
- PkcsMisc.cs
- RepeaterItem.cs
- CmsInterop.cs
- ArithmeticException.cs
- Int64AnimationUsingKeyFrames.cs
- QuotedPairReader.cs
- ObjectViewFactory.cs
- ToolStripArrowRenderEventArgs.cs
- GroupBox.cs
- CodeTypeMember.cs
- ToolStripDropDownItem.cs
- MeshGeometry3D.cs
- ObjectSpanRewriter.cs
- GeneralTransform3D.cs
- DeviceContext.cs
- ToolStripDropDownMenu.cs
- AttributeExtensions.cs
- HandlerBase.cs
- OptimalBreakSession.cs
- AppSettings.cs
- SafeCoTaskMem.cs
- TagMapInfo.cs
- ListViewUpdatedEventArgs.cs
- NativeMethods.cs
- ToolboxItemAttribute.cs
- StringResourceManager.cs
- SecurityKeyIdentifier.cs
- IndicFontClient.cs
- ExceptionUtil.cs
- PropertyRef.cs
- MetafileHeaderWmf.cs
- SqlStream.cs
- Queue.cs
- BindUriHelper.cs
- AdvancedBindingEditor.cs
- FormsIdentity.cs
- ObsoleteAttribute.cs
- SpotLight.cs
- NativeObjectSecurity.cs
- PropertyEntry.cs
- ETagAttribute.cs
- TrackingStringDictionary.cs
- FrameworkRichTextComposition.cs
- DbConnectionClosed.cs
- RealProxy.cs
- DelayedRegex.cs
- DesignerVerb.cs
- EnumValidator.cs
- SoapHeaderException.cs
- PathGeometry.cs
- ObjectListField.cs
- SystemIPGlobalProperties.cs
- DataRowExtensions.cs
- EntityConnectionStringBuilder.cs
- ExtensionFile.cs
- OleDbCommandBuilder.cs
- SequentialOutput.cs
- RoutedUICommand.cs
- DataGridViewSelectedCellCollection.cs
- cache.cs
- ScriptingRoleServiceSection.cs
- RecipientInfo.cs
- DSACryptoServiceProvider.cs
- StateBag.cs
- CodeTypeReferenceExpression.cs
- TakeOrSkipWhileQueryOperator.cs
- LineServices.cs
- FaultCode.cs
- RuntimeHandles.cs
- SelectionRange.cs
- HeaderedContentControl.cs
- PathFigureCollectionConverter.cs
- FaultHandlingFilter.cs
- CustomActivityDesigner.cs
- EntityProviderFactory.cs
- PageBorderless.cs
- ExpressionBinding.cs
- BindingCompleteEventArgs.cs
- CompoundFileDeflateTransform.cs
- DES.cs
- SpellCheck.cs
- TabItemWrapperAutomationPeer.cs