你的位置:主页 > 娱乐节目 >

单方面解析IPTV中CDN技巧

2020-05-12 | 人围观

TempItem.Comment, TempItem.IsApproved, TempItem.IsLockedOut, TempItem.CreationDate, TempItem.LastLoginDate, TempItem.LastActivityDate, TempItem.LastPasswordChangedDate, TempItem.LastLockoutDate ); NewList.Add(NewUser); } return NewList; } public override MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords) { totalRecords = 0; MembershipUserCollection TempList = (MembershipUserCollection) CallWebAdminMembershipProviderHelperMethod("FindUsersByEmail", new object[]{emailToMatch, pageIndex, pageSize, totalRecords}, new Type[] {typeof(string), typeof(int), typeof(int),Type.GetType("System.Int32&")}); MembershipUserCollection NewList = new MembershipUserCollection(); foreach (MembershipUser TempItem in TempList) { MembershipUser NewUser = new MembershipUser(this.Name, TempItem.UserName, TempItem.ProviderUserKey, TempItem.Email, TempItem.PasswordQuestion, TempItem.Comment, TempItem.IsApproved, TempItem.IsLockedOut, TempItem.CreationDate, TempItem.LastLoginDate, TempItem.LastActivityDate, TempItem.LastPasswordChangedDate, TempItem.LastLockoutDate ); NewList.Add(NewUser); } return NewList; } public override int GetNumberOfUsersOnline() { return (int) CallWebAdminMembershipProviderHelperMethod("GetNumberOfUsersOnline", new object[]{}, null); } public override string GetPassword(string name, string answer) { return (string) CallWebAdminMembershipProviderHelperMethod("GetPassword", new object[]{name, answer}, new Type[] {typeof(string), typeof(string)}); } public override MembershipUser GetUser(string name, bool userIsOnline) { MembershipUser TempUser = (MembershipUser)CallWebAdminMembershipProviderHelperMethod("GetUser", new object[]{name, userIsOnline}, new Type[] {typeof(string), typeof(bool)}); MembershipUser NewUser = new MembershipUser(this.Name, TempUser.UserName, TempUser.ProviderUserKey, TempUser.Email, TempUser.PasswordQuestion, TempUser.Comment, TempUser.IsApproved, TempUser.IsLockedOut, TempUser.CreationDate, TempUser.LastLoginDate, TempUser.LastActivityDate, TempUser.LastPasswordChangedDate, TempUser.LastLockoutDate ); return NewUser; } public override string GetUserNameByEmail(string email) { return (string)CallWebAdminMembershipProviderHelperMethod("GetUserNameByEmail", new object[]{email}, new Type[] {typeof(string)}); } public override string ResetPassword(string name, string answer) { return (string)CallWebAdminMembershipProviderHelperMethod("ResetPassword", new object[]{name, answer}, new Type[] {typeof(string), typeof(string)}); } public override void UpdateUser(MembershipUser user) { string typeFullName = "System.Web.Security.MembershipUser, " + typeof(HttpContext).Assembly.GetName().ToString();; Type tempType = Type.GetType(typeFullName); CallWebAdminMembershipProviderHelperMethod("UpdateUser", new object[] {(MembershipUser) user}, new Type[] {tempType}); } public override bool ValidateUser(string name, string password) { return (bool)CallWebAdminMembershipProviderHelperMethod("ValidateUser", new object[]{name, password}, new Type[] {typeof(string), typeof(string)}); } public override MembershipUser GetUser( object providerUserKey, bool userIsOnline ) { return (MembershipUser)CallWebAdminMembershipProviderHelperMethod("GetUser", new object[]{providerUserKey, userIsOnline}, new Type[] {typeof(object), typeof(bool)}); } public override bool UnlockUser( string name ) { return (bool)CallWebAdminMembershipProviderHelperMethod("UnlockUser", new object[]{name}, new Type[] {typeof(string)}); } public override void Initialize(string name, NameValueCollection config) { if (String.IsNullOrEmpty(name)) { name = "WebAdminMembershipProvider"; } base.Initialize(name, config); } public override MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords) { totalRecords = 0; MembershipUserCollection TempList = (MembershipUserCollection)CallWebAdminMembershipProviderHelperMethod("FindUsersByName", new object[]{usernameToMatch, pageIndex, pageSize, totalRecords}, new Type[] {typeof(string), typeof(int), typeof(int), Type.GetType("System.Int32&")}); MembershipUserCollection NewList = new MembershipUserCollection(); foreach (MembershipUser TempItem in TempList) { MembershipUser NewUser = new MembershipUser(this.Name, TempItem.UserName, TempItem.ProviderUserKey, TempItem.Email, TempItem.PasswordQuestion, TempItem.Comment, TempItem.IsApproved, TempItem.IsLockedOut, TempItem.CreationDate, TempItem.LastLoginDate, TempItem.LastActivityDate, TempItem.LastPasswordChangedDate, TempItem.LastLockoutDate ); NewList.Add(NewUser); } return NewList; } } public sealed class WebAdminRemotingManager : MarshalByRefObject { private ApplicationManager _appManager; private string _applicationMetaPath; private string _applicationPhysicalPath; private HttpSessionState _session; private object _configurationHelper; private static string _assemblyVersion; public WebAdminRemotingManager(string applicationMetaPath, string applicationPhysicalPath, HttpSessionState session) { _applicationMetaPath = applicationMetaPath; _applicationPhysicalPath = applicationPhysicalPath; _session = session; } public override Object InitializeLifetimeService(){ return null; // never expire lease } public static string AssemblyVersionString { get { if (String.IsNullOrEmpty(_assemblyVersion)) { _assemblyVersion = "System.Web.Administration.WebAdminConfigurationHelper, " + typeof(HttpContext).Assembly.GetName().ToString(); } return _assemblyVersion; } } private ApplicationManager AppManager { get { if (_appManager == null) { return _appManager = ApplicationManager.GetApplicationManager(); } return _appManager; } } protected string ApplicationMetaPath { get { return _applicationMetaPath; } } public string ApplicationPhysicalPath { get { return _applicationPhysicalPath; } set { _applicationPhysicalPath = value; // Set provider proxy references to null, to account for the edge case where ApplicationPhysicalPath is set twice. // Notes: this does not shut down the target appdomain, which is the desired behavior, since, in the unlikely case where the // ApplicationPhysicalPath is changed, the change is likely to be reverted. Resetting the providers is necessary because // the existing providers point to the old target appdomain. ResetProviders(); } } public object ConfigurationHelperInstance { get { return CreateConfigurationHelper(); } } private HttpSessionState Session { get { return _session; } } public string TargetAppId { get { if (Session["WebAdminTargetAppId"] != null) { return (string)Session["WebAdminTargetAppId"]; } else { return string.Empty; } } set { Session["WebAdminTargetAppId"] = value; } } private object CreateConfigurationHelper() { if (_configurationHelper != null) { return _configurationHelper; } string appPath = ApplicationMetaPath; string appPhysPath = ApplicationPhysicalPath; string targetAppId = String.Empty; string typeFullName = WebAdminRemotingManager.AssemblyVersionString; Type tempType = Type.GetType(typeFullName); // Put together some unique app id string appId = (String.Concat(appPath, appPhysPath).GetHashCode()).ToString("x", CultureInfo.InvariantCulture); _configurationHelper = (object)ApplicationManager.GetApplicationManager().CreateObject(appId, tempType, appPath, appPhysPath, false, true); TargetAppId = appId; return _configurationHelper; } private void EnsureTargetAppId() { if (TargetAppId != null) { return; } // In some cases, the target appdomain exists before the AppId is discovered by AppManager.CreateObjectWithDefaultAppHostAndAppId // (for example if the target app is already running). In this case, retrieve one of the // providers (we make an arbitrary choice to retrieve the membership provider). This forces 内容恳求;

标签:

相关内容推荐:

Top