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
- ToolStripTextBox.cs
- XmlDataProvider.cs
- DesignerAttribute.cs
- HwndAppCommandInputProvider.cs
- TransformerInfo.cs
- SqlAliasesReferenced.cs
- HttpCapabilitiesSectionHandler.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- PasswordBox.cs
- CoTaskMemHandle.cs
- HttpCapabilitiesEvaluator.cs
- WindowsUserNameSecurityTokenAuthenticator.cs
- BufferManager.cs
- AmbientLight.cs
- DbProviderFactory.cs
- SynchronizingStream.cs
- BindableAttribute.cs
- OracleCommand.cs
- ConnectionsZone.cs
- SafeViewOfFileHandle.cs
- TextElement.cs
- Button.cs
- ProvidePropertyAttribute.cs
- ValueQuery.cs
- EventLogPermissionAttribute.cs
- HasCopySemanticsAttribute.cs
- FixedTextPointer.cs
- XmlSchemaObjectTable.cs
- AuthorizationRuleCollection.cs
- Memoizer.cs
- SizeLimitedCache.cs
- StringExpressionSet.cs
- CodeDirectiveCollection.cs
- Pair.cs
- RegexMatch.cs
- PathFigureCollectionConverter.cs
- SortedList.cs
- RuleInfoComparer.cs
- LoadWorkflowAsyncResult.cs
- ErrorFormatter.cs
- DataServiceProcessingPipeline.cs
- IncrementalReadDecoders.cs
- ValidationUtility.cs
- ComponentGlyph.cs
- DataMisalignedException.cs
- LogEntryDeserializer.cs
- MailSettingsSection.cs
- ZipIOFileItemStream.cs
- MenuCommandsChangedEventArgs.cs
- SystemTcpConnection.cs
- ParameterBinding.cs
- EventItfInfo.cs
- TrackingStringDictionary.cs
- Scene3D.cs
- SymbolMethod.cs
- ServiceBusyException.cs
- DataMemberFieldEditor.cs
- DataGridTextBoxColumn.cs
- ConsoleTraceListener.cs
- baseaxisquery.cs
- Rect3D.cs
- MonthCalendar.cs
- EntityClientCacheEntry.cs
- XmlFormatWriterGenerator.cs
- CompiledQuery.cs
- PieceDirectory.cs
- WebPartActionVerb.cs
- GregorianCalendar.cs
- Int16.cs
- ToolStripDropDownClosingEventArgs.cs
- QueryAsyncResult.cs
- Pens.cs
- XmlHierarchyData.cs
- XamlReaderHelper.cs
- externdll.cs
- EvidenceBase.cs
- WebPartCollection.cs
- HtmlControl.cs
- BuilderInfo.cs
- WindowsRichEditRange.cs
- DataGridTableCollection.cs
- Quaternion.cs
- HttpHandlerAction.cs
- ParseHttpDate.cs
- ScriptBehaviorDescriptor.cs
- XhtmlBasicLinkAdapter.cs
- basevalidator.cs
- PieceNameHelper.cs
- MetadataCacheItem.cs
- CommandSet.cs
- Hex.cs
- uribuilder.cs
- SafeFileMapViewHandle.cs
- DesignTimeType.cs
- EllipseGeometry.cs
- ToolStripSettings.cs
- ScrollChrome.cs
- BooleanConverter.cs
- EntityObject.cs
- AudioBase.cs