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
- InputLanguageProfileNotifySink.cs
- BinaryFormatterSinks.cs
- SHA512Managed.cs
- BufferedGraphicsManager.cs
- MessageBox.cs
- CroppedBitmap.cs
- Math.cs
- WebPartConnection.cs
- ContractNamespaceAttribute.cs
- CodeCommentStatementCollection.cs
- GridPatternIdentifiers.cs
- GeneratedCodeAttribute.cs
- GridViewHeaderRowPresenterAutomationPeer.cs
- DockPattern.cs
- RemoteWebConfigurationHostStream.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- Int16.cs
- Crypto.cs
- PolyBezierSegmentFigureLogic.cs
- SecurityPolicySection.cs
- XPathNode.cs
- RequestCacheEntry.cs
- TypeDescriptorContext.cs
- NativeMethods.cs
- InstalledFontCollection.cs
- HandlerFactoryCache.cs
- SecondaryViewProvider.cs
- WindowsButton.cs
- SlipBehavior.cs
- PersistenceMetadataNamespace.cs
- TextPointer.cs
- XmlSchemaNotation.cs
- ComAdminWrapper.cs
- GestureRecognizer.cs
- CellCreator.cs
- HtmlInputButton.cs
- SqlReorderer.cs
- DateTimeUtil.cs
- FormClosingEvent.cs
- UITypeEditor.cs
- TextRangeProviderWrapper.cs
- TypeSource.cs
- AxHost.cs
- DBAsyncResult.cs
- ImpersonateTokenRef.cs
- RepeaterItemCollection.cs
- Rfc2898DeriveBytes.cs
- PropertyCondition.cs
- EncryptedPackageFilter.cs
- PageContent.cs
- SelectedGridItemChangedEvent.cs
- BufferedWebEventProvider.cs
- DBPropSet.cs
- TextEffectResolver.cs
- LinearGradientBrush.cs
- AnnotationResource.cs
- XmlnsPrefixAttribute.cs
- TypeDescriptionProviderAttribute.cs
- TraceRecords.cs
- ClonableStack.cs
- RegexNode.cs
- DataGridHelper.cs
- ColumnClickEvent.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- RuntimeArgumentHandle.cs
- DataGridLength.cs
- LinkClickEvent.cs
- MessageSecurityOverHttpElement.cs
- ObjectListGeneralPage.cs
- LoadItemsEventArgs.cs
- CompressionTransform.cs
- MissingMemberException.cs
- SqlErrorCollection.cs
- RepeaterItemEventArgs.cs
- TextParagraph.cs
- ToolBar.cs
- SqlAliasesReferenced.cs
- OleDbReferenceCollection.cs
- PrinterResolution.cs
- PartialList.cs
- storepermissionattribute.cs
- SerialStream.cs
- UriScheme.cs
- SqlTransaction.cs
- OrthographicCamera.cs
- RemoteWebConfigurationHost.cs
- CorrelationTokenInvalidatedHandler.cs
- TableCellAutomationPeer.cs
- ListArgumentProvider.cs
- ToolTipService.cs
- FormCollection.cs
- LinqDataSourceEditData.cs
- SignedPkcs7.cs
- PageCodeDomTreeGenerator.cs
- ExternalFile.cs
- DataRowView.cs
- Slider.cs
- WebPartActionVerb.cs
- XmlSchema.cs
- DataGridColumnFloatingHeader.cs