⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resetuserpasswords.aspx

📁 本系统是在asp版《在线文件管理器》的基础上设计制作
💻 ASPX
字号:
<%@ Page Language="C#" %>

<script runat="server">

	// you'll want to edit the "loggedInUser.IsAdministrator" line to be
	// ignored manually if you have lost your cookie.  This is a secure check to
	// ensure anyone doesn't hit the page and reset all of your users.
	//

	void Page_Load () {
		User loggedInUser = CSContext.Current.User;
		
		if (loggedInUser.IsAdministrator) {
			bool sendAnything = false;
			
			UserSet countOfUsers = Users.GetUsers(0, 1, true, true);
			UserSet allUsers = Users.GetUsers(0, countOfUsers.TotalRecords, true, true);
			
			Response.Write("TotalRecords=" + allUsers.TotalRecords + "<br>");
			
			foreach (User user in allUsers.Users) {
				if (!user.IsAnonymous) {
					string newPass = "";
					newPass = user.ResetPassword();
					Emails.UserPasswordChanged(user, newPass);
					
					Response.Write("<br>Username=" + user.Username + ", newPass=" + newPass);
					
					sendAnything = true;
				}
			}
			
			if (sendAnything) 
				Response.Write("<br><br>Reset " + allUsers.TotalRecords + " passwords and queued e-mails for all.");
		}
	}	
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -