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
- ToolStripProgressBar.cs
- OutputCacheSettings.cs
- MessagingDescriptionAttribute.cs
- WindowsHyperlink.cs
- CacheSection.cs
- DropAnimation.xaml.cs
- ToolStripComboBox.cs
- RectKeyFrameCollection.cs
- PropertyOverridesDialog.cs
- DataGridViewCellStyleChangedEventArgs.cs
- ProcessActivityTreeOptions.cs
- ContextStack.cs
- DesignerCalendarAdapter.cs
- ZoneLinkButton.cs
- HtmlEncodedRawTextWriter.cs
- ButtonBase.cs
- NullableDoubleMinMaxAggregationOperator.cs
- Hashtable.cs
- SqlCommandSet.cs
- HtmlImage.cs
- Positioning.cs
- WorkflowMarkupElementEventArgs.cs
- AdornerDecorator.cs
- InkCanvasFeedbackAdorner.cs
- OrderingInfo.cs
- ProjectionPruner.cs
- DataViewSetting.cs
- XmlBaseReader.cs
- ManifestResourceInfo.cs
- HashAlgorithm.cs
- HelpProvider.cs
- WebServiceReceiveDesigner.cs
- PaintEvent.cs
- SHA512Managed.cs
- TouchFrameEventArgs.cs
- WebBrowserNavigatedEventHandler.cs
- TypeNameConverter.cs
- RoleService.cs
- BackgroundWorker.cs
- ParenthesizePropertyNameAttribute.cs
- HotCommands.cs
- DataServices.cs
- LayoutUtils.cs
- EventDrivenDesigner.cs
- GraphicsContext.cs
- OptimizedTemplateContentHelper.cs
- MenuStrip.cs
- userdatakeys.cs
- PipeSecurity.cs
- DataGridViewRowsRemovedEventArgs.cs
- MetadataCacheItem.cs
- SimpleHandlerBuildProvider.cs
- RightsManagementEncryptionTransform.cs
- HttpServerVarsCollection.cs
- DataPagerFieldCommandEventArgs.cs
- ScriptMethodAttribute.cs
- BevelBitmapEffect.cs
- Console.cs
- StructuredTypeEmitter.cs
- HtmlTableCell.cs
- FunctionQuery.cs
- WorkflowInvoker.cs
- StrokeNode.cs
- AutoResizedEvent.cs
- WebPartCancelEventArgs.cs
- XmlNamespaceDeclarationsAttribute.cs
- ScriptManagerProxy.cs
- GeneralTransform3DTo2DTo3D.cs
- SmiSettersStream.cs
- TemplatedAdorner.cs
- WebPartHeaderCloseVerb.cs
- COM2IDispatchConverter.cs
- CompilerTypeWithParams.cs
- ComponentResourceKeyConverter.cs
- StreamedFramingRequestChannel.cs
- ChannelSinkStacks.cs
- HTMLTagNameToTypeMapper.cs
- DbDeleteCommandTree.cs
- _MultipleConnectAsync.cs
- XmlSchemaSimpleContentRestriction.cs
- ImageList.cs
- BevelBitmapEffect.cs
- BrowserTree.cs
- BindingContext.cs
- SchemaLookupTable.cs
- DataGridViewDataErrorEventArgs.cs
- RequestQueryParser.cs
- TraceHelpers.cs
- FilterableAttribute.cs
- PartDesigner.cs
- Win32MouseDevice.cs
- TraceFilter.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ECDsa.cs
- FtpCachePolicyElement.cs
- DateTimeOffsetAdapter.cs
- Comparer.cs
- TypeCodeDomSerializer.cs
- StateFinalizationActivity.cs
- EntityRecordInfo.cs