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
- GifBitmapEncoder.cs
- XamlPathDataSerializer.cs
- StreamUpdate.cs
- ControlAdapter.cs
- Missing.cs
- AssociationTypeEmitter.cs
- CompiledQuery.cs
- QilScopedVisitor.cs
- ShapingWorkspace.cs
- InertiaTranslationBehavior.cs
- Number.cs
- XPathPatternParser.cs
- ComponentResourceKeyConverter.cs
- PersianCalendar.cs
- AsymmetricSignatureFormatter.cs
- Graph.cs
- Hashtable.cs
- EventLogInternal.cs
- PowerModeChangedEventArgs.cs
- ExtractedStateEntry.cs
- TriggerBase.cs
- FeatureSupport.cs
- PermissionRequestEvidence.cs
- TripleDES.cs
- CharUnicodeInfo.cs
- TraceContext.cs
- PointAnimationBase.cs
- BulletDecorator.cs
- ChannelServices.cs
- ComponentEditorForm.cs
- Point3DCollection.cs
- GridViewColumnHeaderAutomationPeer.cs
- PassportAuthenticationModule.cs
- OutOfMemoryException.cs
- SoapAttributeAttribute.cs
- StrongTypingException.cs
- InvokeMethodActivityDesigner.cs
- UIntPtr.cs
- MenuStrip.cs
- Scene3D.cs
- SafeLibraryHandle.cs
- CodeCompiler.cs
- PartialCachingControl.cs
- StringConcat.cs
- MsmqIntegrationValidationBehavior.cs
- uribuilder.cs
- TrustLevel.cs
- AsyncOperation.cs
- HostingEnvironmentException.cs
- SoapSchemaImporter.cs
- CompilationUnit.cs
- ConvertEvent.cs
- LogSwitch.cs
- SqlFunctionAttribute.cs
- MouseButton.cs
- MenuItemStyleCollection.cs
- InkCanvasSelection.cs
- StyleXamlParser.cs
- SmtpFailedRecipientException.cs
- XamlStyleSerializer.cs
- XmlQueryStaticData.cs
- XMLSchema.cs
- WorkerRequest.cs
- EdgeModeValidation.cs
- EntityConnection.cs
- ListViewUpdateEventArgs.cs
- RuntimeConfigLKG.cs
- ProfilePropertyNameValidator.cs
- DataSet.cs
- ColorMap.cs
- SqlMethodAttribute.cs
- CssTextWriter.cs
- BufferedGraphicsManager.cs
- DirectoryLocalQuery.cs
- MessageLogTraceRecord.cs
- PaintEvent.cs
- XmlAnyElementAttributes.cs
- WebPartsPersonalizationAuthorization.cs
- WindowExtensionMethods.cs
- DataGridViewRowsAddedEventArgs.cs
- HtmlElementErrorEventArgs.cs
- ValueProviderWrapper.cs
- XamlToRtfParser.cs
- DrawToolTipEventArgs.cs
- TimeSpanConverter.cs
- Encoder.cs
- MessageAction.cs
- HTTPNotFoundHandler.cs
- MenuItem.cs
- StrokeNodeOperations.cs
- FontWeight.cs
- NamedPermissionSet.cs
- VectorAnimation.cs
- DependencyObject.cs
- TreeViewImageKeyConverter.cs
- GenerateHelper.cs
- BeginEvent.cs
- IChannel.cs
- ProtocolsSection.cs
- HashHelper.cs