Code:
/ DotNET / DotNET / 8.0 / untmp / Orcas / RTM / ndp / fx / src / xsp / System / Web / Extensions / Security / AuthenticationService.cs / 1 / 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. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CollectionTypeElement.cs
- DecoderFallback.cs
- SafeBitVector32.cs
- SqlNodeAnnotation.cs
- WindowsGraphics.cs
- ButtonStandardAdapter.cs
- MenuItemBinding.cs
- ConstNode.cs
- StringFormat.cs
- GenericEnumConverter.cs
- SiteIdentityPermission.cs
- WebPartTransformer.cs
- OracleBinary.cs
- EntityCollection.cs
- ContentElement.cs
- DocumentGrid.cs
- HttpRequestCacheValidator.cs
- XmlElementAttributes.cs
- MimeMultiPart.cs
- DocumentGridContextMenu.cs
- xmlsaver.cs
- OdbcReferenceCollection.cs
- CodeCatchClause.cs
- KeyMatchBuilder.cs
- SettingsPropertyWrongTypeException.cs
- InkCollectionBehavior.cs
- ConfigurationManager.cs
- TypeInitializationException.cs
- CodeNamespace.cs
- FormsAuthenticationCredentials.cs
- CommandBindingCollection.cs
- XMLSyntaxException.cs
- SchemaTableColumn.cs
- MeshGeometry3D.cs
- PropertyTabChangedEvent.cs
- ToggleButton.cs
- webclient.cs
- DivideByZeroException.cs
- ScriptIgnoreAttribute.cs
- PartitionedStream.cs
- ThemeInfoAttribute.cs
- ToolStripItem.cs
- Attribute.cs
- LogLogRecordEnumerator.cs
- DetailsView.cs
- CompiledELinqQueryState.cs
- ColorAnimation.cs
- ProxyManager.cs
- ECDiffieHellmanCngPublicKey.cs
- IResourceProvider.cs
- Metafile.cs
- GridViewRowCollection.cs
- DataGridViewCheckBoxCell.cs
- Model3D.cs
- IpcManager.cs
- Misc.cs
- TextBox.cs
- GroupBox.cs
- DependencyPropertyHelper.cs
- DbConnectionPoolOptions.cs
- LinkLabelLinkClickedEvent.cs
- SemanticResultKey.cs
- WinEventQueueItem.cs
- HtmlInputRadioButton.cs
- XmlDocumentType.cs
- BitmapMetadataBlob.cs
- MailMessageEventArgs.cs
- OuterGlowBitmapEffect.cs
- AccessDataSourceDesigner.cs
- RadioButtonStandardAdapter.cs
- ToolboxBitmapAttribute.cs
- ADMembershipUser.cs
- SqlInternalConnectionSmi.cs
- CodeCompiler.cs
- SAPIEngineTypes.cs
- ChtmlTextWriter.cs
- GeneralTransformGroup.cs
- Identity.cs
- MenuCommands.cs
- SqlError.cs
- XmlBoundElement.cs
- CollectionTraceRecord.cs
- MarkupCompilePass2.cs
- AddInAttribute.cs
- CollectionViewProxy.cs
- TextRangeProviderWrapper.cs
- SimpleExpression.cs
- HyperLinkDataBindingHandler.cs
- RegularExpressionValidator.cs
- PublishLicense.cs
- InstanceDataCollectionCollection.cs
- ScriptControlDescriptor.cs
- DocumentSequenceHighlightLayer.cs
- ISAPIWorkerRequest.cs
- AxisAngleRotation3D.cs
- CDSCollectionETWBCLProvider.cs
- CaseInsensitiveHashCodeProvider.cs
- RawStylusInputReport.cs
- ByteStorage.cs
- ApplicationServiceManager.cs