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
- DoubleSumAggregationOperator.cs
- Simplifier.cs
- DependencyPropertyAttribute.cs
- IntranetCredentialPolicy.cs
- BitmapEffectInput.cs
- DataChangedEventManager.cs
- handlecollector.cs
- RawStylusInputCustomDataList.cs
- NativeMethods.cs
- ViewEvent.cs
- QilScopedVisitor.cs
- ConnectionProviderAttribute.cs
- DBDataPermissionAttribute.cs
- listitem.cs
- Mappings.cs
- SqlRemoveConstantOrderBy.cs
- DesignerAdapterAttribute.cs
- InfoCardCryptoHelper.cs
- FormCollection.cs
- MessageDecoder.cs
- Label.cs
- FileAccessException.cs
- XmlTextWriter.cs
- TypeToken.cs
- WebPartConnectionsConnectVerb.cs
- ContractSearchPattern.cs
- EventProperty.cs
- MultipartIdentifier.cs
- NativeMethods.cs
- EnumConverter.cs
- sqlcontext.cs
- CodeIdentifiers.cs
- Events.cs
- FileStream.cs
- MessageDecoder.cs
- IfJoinedCondition.cs
- XPathSelectionIterator.cs
- DbProviderServices.cs
- FontStyle.cs
- SqlConnectionPoolProviderInfo.cs
- XamlLoadErrorInfo.cs
- ShapingWorkspace.cs
- EventHandlingScope.cs
- SiteMap.cs
- DbProviderFactoriesConfigurationHandler.cs
- _NTAuthentication.cs
- BlockCollection.cs
- ObjectItemAttributeAssemblyLoader.cs
- ObjectTypeMapping.cs
- CrossContextChannel.cs
- NaturalLanguageHyphenator.cs
- TypedReference.cs
- ExecutedRoutedEventArgs.cs
- OdbcDataReader.cs
- ProviderCollection.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- DecimalAnimationUsingKeyFrames.cs
- DataTableReader.cs
- TreeViewItemAutomationPeer.cs
- IsolatedStorageSecurityState.cs
- MailHeaderInfo.cs
- ToolStripDropTargetManager.cs
- KeyboardDevice.cs
- ThemeDirectoryCompiler.cs
- StringResourceManager.cs
- RewritingPass.cs
- ExpandableObjectConverter.cs
- ScriptHandlerFactory.cs
- DataBoundLiteralControl.cs
- AutomationAttributeInfo.cs
- XamlInt32CollectionSerializer.cs
- BitmapFrame.cs
- PostBackTrigger.cs
- CompositeTypefaceMetrics.cs
- DirectoryNotFoundException.cs
- CharacterBufferReference.cs
- SqlException.cs
- ReaderWriterLock.cs
- PackagePart.cs
- PathFigure.cs
- TypeExtensionConverter.cs
- RichTextBox.cs
- ADMembershipUser.cs
- KeyValuePair.cs
- RijndaelManaged.cs
- QueryStringHandler.cs
- Size3DConverter.cs
- WindowsRichEditRange.cs
- XmlAttributeCollection.cs
- LoginCancelEventArgs.cs
- XmlAttributeCollection.cs
- CompositeFontFamily.cs
- TargetControlTypeAttribute.cs
- PathFigureCollection.cs
- NativeCppClassAttribute.cs
- ToolTip.cs
- EditorPartChrome.cs
- StylusCollection.cs
- StylusCaptureWithinProperty.cs
- DispatcherObject.cs