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
- SizeLimitedCache.cs
- ScriptManager.cs
- ToolboxItemImageConverter.cs
- XpsS0ValidatingLoader.cs
- XmlMapping.cs
- StringStorage.cs
- TextDecorations.cs
- StringDictionary.cs
- Object.cs
- XPathScanner.cs
- UrlPath.cs
- FontNamesConverter.cs
- String.cs
- ElementAtQueryOperator.cs
- Region.cs
- MessageEnumerator.cs
- diagnosticsswitches.cs
- BitmapFrameDecode.cs
- EntityProxyTypeInfo.cs
- FlowLayoutPanel.cs
- ProfileServiceManager.cs
- HttpRuntime.cs
- HwndStylusInputProvider.cs
- ReflectEventDescriptor.cs
- LogicalTreeHelper.cs
- Predicate.cs
- SingleKeyFrameCollection.cs
- ToolstripProfessionalRenderer.cs
- MetadataSerializer.cs
- parserscommon.cs
- GraphicsState.cs
- FieldNameLookup.cs
- TraversalRequest.cs
- Animatable.cs
- Themes.cs
- NumericExpr.cs
- HtmlPhoneCallAdapter.cs
- XamlGridLengthSerializer.cs
- BrowserCapabilitiesCodeGenerator.cs
- IndexOutOfRangeException.cs
- RegexBoyerMoore.cs
- DragEvent.cs
- DesignerSerializationOptionsAttribute.cs
- SessionParameter.cs
- StateMachine.cs
- SqlTypeConverter.cs
- CornerRadiusConverter.cs
- TextParagraphCache.cs
- Relationship.cs
- NonPrimarySelectionGlyph.cs
- ListenerConnectionModeReader.cs
- Panel.cs
- SizeAnimation.cs
- EntityWrapper.cs
- SubMenuStyleCollection.cs
- AutomationPropertyInfo.cs
- ProfileInfo.cs
- OdbcEnvironmentHandle.cs
- GrammarBuilderRuleRef.cs
- StorageMappingFragment.cs
- RayMeshGeometry3DHitTestResult.cs
- BamlLocalizableResource.cs
- WarningException.cs
- MappingException.cs
- Control.cs
- WorkItem.cs
- CompilationUnit.cs
- GreenMethods.cs
- RC2CryptoServiceProvider.cs
- VersionedStream.cs
- SchemaHelper.cs
- WbmpConverter.cs
- StylusPoint.cs
- NotifyIcon.cs
- CroppedBitmap.cs
- storepermission.cs
- ReflectionTypeLoadException.cs
- DecoderReplacementFallback.cs
- CodeSubDirectory.cs
- DataGridCommandEventArgs.cs
- PropertyDescriptorGridEntry.cs
- DataGridItemEventArgs.cs
- ObjectKeyFrameCollection.cs
- DispatcherFrame.cs
- HttpModuleActionCollection.cs
- PageThemeCodeDomTreeGenerator.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- EncryptedType.cs
- EmitterCache.cs
- DataColumnMappingCollection.cs
- SessionStateContainer.cs
- ConsumerConnectionPoint.cs
- WebEventCodes.cs
- PropertyInfo.cs
- ColumnResult.cs
- TreeViewDesigner.cs
- UpdateRecord.cs
- StreamSecurityUpgradeAcceptor.cs
- HiddenField.cs
- ValueOfAction.cs