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
- Win32KeyboardDevice.cs
- DmlSqlGenerator.cs
- ValueTypeFixupInfo.cs
- ObjectStateEntryOriginalDbUpdatableDataRecord.cs
- GraphicsPath.cs
- SoapProtocolImporter.cs
- securitycriticaldataClass.cs
- LifetimeServices.cs
- ImageFormatConverter.cs
- RijndaelCryptoServiceProvider.cs
- OracleBFile.cs
- PreservationFileWriter.cs
- TransformProviderWrapper.cs
- SQLBinary.cs
- SemaphoreSecurity.cs
- ReferenceEqualityComparer.cs
- TaiwanLunisolarCalendar.cs
- UIEndRequest.cs
- cache.cs
- MouseButtonEventArgs.cs
- StringDictionary.cs
- CheckBoxPopupAdapter.cs
- Marshal.cs
- RSACryptoServiceProvider.cs
- MarginsConverter.cs
- TemplateAction.cs
- ItemDragEvent.cs
- ScrollProperties.cs
- XmlNodeChangedEventArgs.cs
- UniqueIdentifierService.cs
- HostingEnvironmentException.cs
- CngAlgorithmGroup.cs
- VScrollProperties.cs
- PropertyTabChangedEvent.cs
- StylusCollection.cs
- Error.cs
- RepeatButtonAutomationPeer.cs
- TableLayoutRowStyleCollection.cs
- DbgCompiler.cs
- DataGridViewColumnDesigner.cs
- BaseCodeDomTreeGenerator.cs
- RadioButtonBaseAdapter.cs
- XmlAnyElementAttribute.cs
- MouseEvent.cs
- TextViewSelectionProcessor.cs
- PageBreakRecord.cs
- StyleXamlParser.cs
- ReachFixedPageSerializerAsync.cs
- GetReadStreamResult.cs
- Int16KeyFrameCollection.cs
- Identity.cs
- MemberMaps.cs
- TrustSection.cs
- Vector3DCollection.cs
- DataGridViewTopRowAccessibleObject.cs
- MoveSizeWinEventHandler.cs
- MarshalByValueComponent.cs
- ToolStripDropTargetManager.cs
- DataBoundLiteralControl.cs
- Confirm.cs
- WindowsStatic.cs
- SQLConvert.cs
- WebRequestModuleElementCollection.cs
- EventLogEntry.cs
- TrackingQuery.cs
- DisposableCollectionWrapper.cs
- WebPartConnectionsCancelVerb.cs
- DataGridViewCellParsingEventArgs.cs
- DocumentPageViewAutomationPeer.cs
- SerializationObjectManager.cs
- SqlMetaData.cs
- CheckBoxList.cs
- LinkButton.cs
- CodeVariableDeclarationStatement.cs
- TreeViewItemAutomationPeer.cs
- PropertyValidationContext.cs
- _RegBlobWebProxyDataBuilder.cs
- DoubleLinkList.cs
- CodeAttributeArgument.cs
- ContainerFilterService.cs
- BamlResourceSerializer.cs
- IndexOutOfRangeException.cs
- WebPartRestoreVerb.cs
- MemberDescriptor.cs
- SvcMapFileLoader.cs
- PackagingUtilities.cs
- CodeDOMProvider.cs
- ZipIOExtraFieldPaddingElement.cs
- TreeNodeMouseHoverEvent.cs
- SchemaImporterExtensionElementCollection.cs
- ClassHandlersStore.cs
- DateTimeConstantAttribute.cs
- NameValueCollection.cs
- EventListener.cs
- ResponseBodyWriter.cs
- XamlSerializerUtil.cs
- SchemaSetCompiler.cs
- PointUtil.cs
- Symbol.cs
- StringFunctions.cs