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
- QilGeneratorEnv.cs
- PerformanceCountersElement.cs
- SqlDependencyListener.cs
- OleDbConnectionPoolGroupProviderInfo.cs
- x509store.cs
- ProxyHelper.cs
- StylusPointProperty.cs
- RegexRunnerFactory.cs
- QueryStack.cs
- SpeechRecognizer.cs
- precedingquery.cs
- CodeExpressionStatement.cs
- FtpWebRequest.cs
- ParserContext.cs
- SqlWebEventProvider.cs
- WebPartsPersonalizationAuthorization.cs
- XmlUrlResolver.cs
- HtmlString.cs
- Geometry3D.cs
- LocalValueEnumerator.cs
- InputBindingCollection.cs
- IndicFontClient.cs
- DetailsViewModeEventArgs.cs
- Message.cs
- AsyncPostBackErrorEventArgs.cs
- CommonEndpointBehaviorElement.cs
- Select.cs
- NameValuePermission.cs
- OperationFormatUse.cs
- TextEffect.cs
- ResourceCategoryAttribute.cs
- HotSpotCollection.cs
- FixedSOMSemanticBox.cs
- ResourceReferenceExpression.cs
- DockPattern.cs
- SecurityStandardsManager.cs
- VisualTarget.cs
- LocatorGroup.cs
- WorkflowTimerService.cs
- ModuleBuilderData.cs
- TypedTableBaseExtensions.cs
- ToolStripPanelRenderEventArgs.cs
- EncryptedPackageFilter.cs
- Compiler.cs
- Point.cs
- SerializationFieldInfo.cs
- MemberCollection.cs
- ConvertersCollection.cs
- CharEntityEncoderFallback.cs
- DesignerToolStripControlHost.cs
- IsolatedStoragePermission.cs
- x509store.cs
- PeerApplicationLaunchInfo.cs
- coordinatorfactory.cs
- SvcFileManager.cs
- Constraint.cs
- InlineCollection.cs
- EdmMember.cs
- DecoratedNameAttribute.cs
- DbParameterHelper.cs
- StickyNoteAnnotations.cs
- ValidationHelper.cs
- CodeMemberMethod.cs
- ComponentResourceKey.cs
- GlobalizationSection.cs
- XmlSchemaException.cs
- AutomationElement.cs
- XmlTypeMapping.cs
- DataListItem.cs
- TableLayoutStyleCollection.cs
- ConfigurationSchemaErrors.cs
- ComplexBindingPropertiesAttribute.cs
- Funcletizer.cs
- FacetValues.cs
- DocumentReference.cs
- BaseEntityWrapper.cs
- QilGenerator.cs
- StreamUpgradeAcceptor.cs
- ControlAdapter.cs
- LinqDataSourceHelper.cs
- ListItemCollection.cs
- DesignTimeParseData.cs
- Renderer.cs
- baseaxisquery.cs
- ScriptControlManager.cs
- GradientStop.cs
- IndentTextWriter.cs
- DataServiceProviderWrapper.cs
- ContourSegment.cs
- EventLogTraceListener.cs
- HwndKeyboardInputProvider.cs
- ActiveDocumentEvent.cs
- RegexCharClass.cs
- basemetadatamappingvisitor.cs
- GeneralTransform2DTo3D.cs
- CryptoProvider.cs
- InvalidEnumArgumentException.cs
- BindingCompleteEventArgs.cs
- BlockingCollection.cs
- NameValuePair.cs