Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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. // //----------------------------------------------------------------------------- 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
- MailWriter.cs
- BaseParaClient.cs
- ParallelTimeline.cs
- FileLevelControlBuilderAttribute.cs
- HtmlTernaryTree.cs
- FaultFormatter.cs
- IsolatedStorageFile.cs
- MultiTrigger.cs
- LabelEditEvent.cs
- Mapping.cs
- SelectionProcessor.cs
- StaticContext.cs
- DelegateArgumentValue.cs
- Delegate.cs
- SerializationException.cs
- HierarchicalDataTemplate.cs
- InputMethodStateTypeInfo.cs
- Pkcs7Signer.cs
- Compiler.cs
- StorageInfo.cs
- SpeechSeg.cs
- OleDbDataAdapter.cs
- Soap12FormatExtensions.cs
- XslAst.cs
- XmlDataSource.cs
- GenericTypeParameterBuilder.cs
- TypeLoadException.cs
- DecimalConverter.cs
- GPPOINTF.cs
- ExpandSegmentCollection.cs
- SecurityTokenProvider.cs
- ConfigurationPropertyAttribute.cs
- StartUpEventArgs.cs
- _LocalDataStoreMgr.cs
- Image.cs
- WebPartCatalogCloseVerb.cs
- SafeViewOfFileHandle.cs
- LassoHelper.cs
- DoubleLinkList.cs
- PrePostDescendentsWalker.cs
- OdbcConnectionStringbuilder.cs
- Encoder.cs
- BulletedListEventArgs.cs
- NavigationService.cs
- EllipseGeometry.cs
- Int64Converter.cs
- CAGDesigner.cs
- EncodingDataItem.cs
- ReadonlyMessageFilter.cs
- NavigationProgressEventArgs.cs
- fixedPageContentExtractor.cs
- ResourceReferenceExpressionConverter.cs
- DataProtectionSecurityStateEncoder.cs
- CheckBoxRenderer.cs
- ProxyHwnd.cs
- StreamSecurityUpgradeInitiatorAsyncResult.cs
- SimpleLine.cs
- DataTransferEventArgs.cs
- CompiledELinqQueryState.cs
- DropDownList.cs
- OleDbWrapper.cs
- ListViewDataItem.cs
- PageContentAsyncResult.cs
- CompModSwitches.cs
- ICollection.cs
- loginstatus.cs
- CompilerParameters.cs
- PointAnimationClockResource.cs
- assemblycache.cs
- Clock.cs
- HuffCodec.cs
- SeekableReadStream.cs
- JsonServiceDocumentSerializer.cs
- RSACryptoServiceProvider.cs
- PatternMatcher.cs
- WindowsToolbarAsMenu.cs
- SerializationStore.cs
- HttpRuntimeSection.cs
- TemplateContent.cs
- UnsafeCollabNativeMethods.cs
- ServicesUtilities.cs
- CompiledQueryCacheKey.cs
- TabletDeviceInfo.cs
- TextEditorContextMenu.cs
- ArraySubsetEnumerator.cs
- AnnotationStore.cs
- CompositeActivityValidator.cs
- SQLDouble.cs
- CompositionAdorner.cs
- RectIndependentAnimationStorage.cs
- GridErrorDlg.cs
- TextChangedEventArgs.cs
- CompletionProxy.cs
- ListViewItemSelectionChangedEvent.cs
- SqlInternalConnection.cs
- ObjectMemberMapping.cs
- AuthorizationRule.cs
- XmlSchemaImporter.cs
- ListViewDeleteEventArgs.cs
- Dynamic.cs