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
- FileDialogCustomPlace.cs
- ConnectionsZone.cs
- WebEventTraceProvider.cs
- CodeTypeDeclarationCollection.cs
- AlignmentYValidation.cs
- XXXInfos.cs
- NTAccount.cs
- mactripleDES.cs
- StylusDownEventArgs.cs
- WeakHashtable.cs
- HtmlInputPassword.cs
- FolderLevelBuildProviderCollection.cs
- HwndKeyboardInputProvider.cs
- ParagraphVisual.cs
- StringInfo.cs
- GPRECT.cs
- AsnEncodedData.cs
- ValueChangedEventManager.cs
- FirstMatchCodeGroup.cs
- TreeViewEvent.cs
- Control.cs
- TypeToken.cs
- DbMetaDataCollectionNames.cs
- XmlWrappingReader.cs
- CommandBinding.cs
- DynamicRendererThreadManager.cs
- EventProviderClassic.cs
- ObjectKeyFrameCollection.cs
- TypeToStringValueConverter.cs
- ToolStripDropTargetManager.cs
- ApplicationDirectory.cs
- LineServicesRun.cs
- WhereQueryOperator.cs
- CreateUserErrorEventArgs.cs
- TimeSpanValidatorAttribute.cs
- ScrollEventArgs.cs
- StickyNote.cs
- ExtendedTransformFactory.cs
- DataPagerFieldItem.cs
- DataSourceGroupCollection.cs
- DataTableNameHandler.cs
- WindowsAuthenticationEventArgs.cs
- TdsValueSetter.cs
- ScriptManagerProxy.cs
- DiscriminatorMap.cs
- UpDownBase.cs
- InterleavedZipPartStream.cs
- UpDownBaseDesigner.cs
- RadioButtonBaseAdapter.cs
- VariantWrapper.cs
- SubpageParaClient.cs
- ExternalException.cs
- CollectionsUtil.cs
- TypeConverter.cs
- ListViewVirtualItemsSelectionRangeChangedEvent.cs
- TypeElement.cs
- ExpressionDumper.cs
- UICuesEvent.cs
- HwndSourceKeyboardInputSite.cs
- log.cs
- PlaceHolder.cs
- DataContractAttribute.cs
- MultiSelectRootGridEntry.cs
- RegexReplacement.cs
- IPCCacheManager.cs
- InputMethod.cs
- EncoderExceptionFallback.cs
- LineGeometry.cs
- StyleReferenceConverter.cs
- TrackingStringDictionary.cs
- SHA1.cs
- SystemIPGlobalProperties.cs
- MapPathBasedVirtualPathProvider.cs
- Stack.cs
- DocumentViewer.cs
- WebRequestModulesSection.cs
- TreeNodeCollection.cs
- DictionaryEntry.cs
- Span.cs
- CommandValueSerializer.cs
- XmlWrappingReader.cs
- HttpClientCertificate.cs
- FileUpload.cs
- UpdatePanelControlTrigger.cs
- EntityDataSourceSelectedEventArgs.cs
- AutoCompleteStringCollection.cs
- XmlWriterTraceListener.cs
- XpsS0ValidatingLoader.cs
- ConsoleCancelEventArgs.cs
- SystemDropShadowChrome.cs
- HostedHttpContext.cs
- AsyncOperation.cs
- FormsIdentity.cs
- FrameworkTextComposition.cs
- OleDbDataReader.cs
- GridSplitter.cs
- XmlEncoding.cs
- InternalControlCollection.cs
- DataGridTextBoxColumn.cs
- ReadOnlyDictionary.cs