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
- ToolTip.cs
- WebPartConnectionsConfigureVerb.cs
- QueryGeneratorBase.cs
- WindowsStatic.cs
- SqlNotificationRequest.cs
- DbProviderFactories.cs
- PackUriHelper.cs
- DelegatedStream.cs
- HttpCookiesSection.cs
- ThaiBuddhistCalendar.cs
- TrackingDataItemValue.cs
- RoutedEventConverter.cs
- ImplicitInputBrush.cs
- TextBoxAutoCompleteSourceConverter.cs
- Condition.cs
- StringFormat.cs
- TextContainerHelper.cs
- XmlSchemaSimpleType.cs
- RC2.cs
- GridViewRowPresenterBase.cs
- Ports.cs
- ParserOptions.cs
- CompilerGeneratedAttribute.cs
- DataBoundControlHelper.cs
- IsolationInterop.cs
- ProxyBuilder.cs
- TiffBitmapEncoder.cs
- ConcatQueryOperator.cs
- Preprocessor.cs
- CharKeyFrameCollection.cs
- WindowsSlider.cs
- ThreadNeutralSemaphore.cs
- PermissionAttributes.cs
- AmbientValueAttribute.cs
- SoapMessage.cs
- ImageButton.cs
- RangeValuePatternIdentifiers.cs
- ObjectAssociationEndMapping.cs
- StructuralCache.cs
- MissingSatelliteAssemblyException.cs
- FieldDescriptor.cs
- CodeGroup.cs
- CmsInterop.cs
- TreeNodeBindingCollection.cs
- TransformPattern.cs
- PersistenceTypeAttribute.cs
- RectValueSerializer.cs
- ConfigXmlSignificantWhitespace.cs
- Stack.cs
- InputBinder.cs
- SqlLiftIndependentRowExpressions.cs
- Margins.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- TablePattern.cs
- TreeNodeStyle.cs
- OneToOneMappingSerializer.cs
- ChangesetResponse.cs
- InvalidPrinterException.cs
- SimplePropertyEntry.cs
- MemoryFailPoint.cs
- SqlClientMetaDataCollectionNames.cs
- ObjectIDGenerator.cs
- BuildResultCache.cs
- Lookup.cs
- EpmTargetTree.cs
- VariableDesigner.xaml.cs
- SequentialWorkflowRootDesigner.cs
- SmiRecordBuffer.cs
- Coordinator.cs
- EditorAttributeInfo.cs
- MethodBuilderInstantiation.cs
- TextEmbeddedObject.cs
- BuiltInPermissionSets.cs
- EditCommandColumn.cs
- SQLDecimal.cs
- DataGridViewHitTestInfo.cs
- ObjectDataSourceFilteringEventArgs.cs
- TreeViewItemAutomationPeer.cs
- LiteralControl.cs
- MailHeaderInfo.cs
- XmlCharCheckingReader.cs
- ScrollChrome.cs
- safex509handles.cs
- MethodToken.cs
- URIFormatException.cs
- TypeBuilder.cs
- ActivityDesignerResources.cs
- QilValidationVisitor.cs
- TreeIterator.cs
- LogSwitch.cs
- DoubleAnimationBase.cs
- MetadataCacheItem.cs
- SafeHGlobalHandleCritical.cs
- PathSegment.cs
- Errors.cs
- ThreadPool.cs
- DurableOperationContext.cs
- DBCSCodePageEncoding.cs
- CodeDomConfigurationHandler.cs
- ZipIOFileItemStream.cs