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
- ObjectPropertyMapping.cs
- DeferredReference.cs
- COM2AboutBoxPropertyDescriptor.cs
- SafeArrayRankMismatchException.cs
- SerializerWriterEventHandlers.cs
- Rotation3DAnimationUsingKeyFrames.cs
- SparseMemoryStream.cs
- LinkLabelLinkClickedEvent.cs
- DbInsertCommandTree.cs
- _emptywebproxy.cs
- SplashScreen.cs
- WebPartMenuStyle.cs
- GridViewSortEventArgs.cs
- ArrayTypeMismatchException.cs
- DesignConnectionCollection.cs
- ContextProperty.cs
- SoapIncludeAttribute.cs
- InvokeHandlers.cs
- AdRotatorDesigner.cs
- RoutedEventConverter.cs
- GridViewRowPresenterBase.cs
- ProgressBarBrushConverter.cs
- dtdvalidator.cs
- FunctionOverloadResolver.cs
- ByteStreamMessageEncoder.cs
- CalendarDateChangedEventArgs.cs
- DataGridViewRow.cs
- ParameterBuilder.cs
- TextParagraphCache.cs
- GrammarBuilderWildcard.cs
- WindowsStatusBar.cs
- LinkDescriptor.cs
- BaseProcessor.cs
- XPathExpr.cs
- DrawListViewSubItemEventArgs.cs
- DelayedRegex.cs
- Journal.cs
- RowBinding.cs
- RenderContext.cs
- ProxyWebPartManagerDesigner.cs
- PeerName.cs
- SQLDoubleStorage.cs
- WinInetCache.cs
- FloaterBaseParaClient.cs
- SharedPerformanceCounter.cs
- WrappedIUnknown.cs
- TransactionsSectionGroup.cs
- InheritanceContextChangedEventManager.cs
- PhysicalOps.cs
- Queue.cs
- ProfessionalColorTable.cs
- DispatchWrapper.cs
- AuthorizationRuleCollection.cs
- ScriptControlManager.cs
- PictureBox.cs
- RoleService.cs
- RandomNumberGenerator.cs
- IfJoinedCondition.cs
- COMException.cs
- COM2PropertyBuilderUITypeEditor.cs
- ActivityStatusChangeEventArgs.cs
- RightsManagementInformation.cs
- DbProviderConfigurationHandler.cs
- CheckoutException.cs
- ImplicitInputBrush.cs
- GeneralTransform2DTo3DTo2D.cs
- TimeSpanParse.cs
- Line.cs
- ImageButton.cs
- BamlCollectionHolder.cs
- BindingRestrictions.cs
- HtmlInputPassword.cs
- AmbientLight.cs
- StyleCollection.cs
- ListBindingConverter.cs
- SafePEFileHandle.cs
- FrameDimension.cs
- DnsPermission.cs
- RealizationContext.cs
- CanonicalXml.cs
- FontUnitConverter.cs
- SequentialWorkflowHeaderFooter.cs
- OracleInfoMessageEventArgs.cs
- HwndAppCommandInputProvider.cs
- StylusTip.cs
- ContextProperty.cs
- XPathNodeHelper.cs
- Crc32.cs
- DataView.cs
- Avt.cs
- NominalTypeEliminator.cs
- ListControlConvertEventArgs.cs
- SelectionUIHandler.cs
- PathFigureCollection.cs
- DataGridCell.cs
- _UriTypeConverter.cs
- RawContentTypeMapper.cs
- ServicesSection.cs
- TakeQueryOptionExpression.cs
- PenContext.cs