每日一贴,今天的容内关键字为密码注册
<title>个人会员密码找回</title>
<link href="/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
// 检查 E-mail 否是已被注册
function CheckEmail()
{
var e = document.getElementById("email").value;
if(e != "")
{
if(!/(\S)+[@]{1}(\S)+[.]{1}(\w)+/.test(e))
{
alert("请入输式格准确的E-mail 址地!");
var email = document.getElementById ( "email" );
email.value = "";
email.focus ();
}
}
}
function checkAll()
{
var ee = document.getElementById("username").value;
if(ee == "")
{
alert('登录名称不能为空');
return false;
}
var e = document.getElementById("email").value;
if(e == "")
{
alert('Emial不能为空');
return false;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="778" border="0" align="center" cellpadding="5" cellspacing="0" class="table_huang">
<tr>
<td colspan="2" class="TD_huang_14_write"> <span style="font-size: 11pt">>> 获得密码</span></td>
</tr>
<tr>
<td width="26"></td>
<td width="724"><table width="90%" border="0" cellspacing="2" cellpadding="5">
<tr>
<td width="23%"><div align="right">户用名:</div></td>
<td width="77%">
<asp:TextBox ID="username" runat="server" Width="150px" ></asp:TextBox></td>
</tr>
<tr>
<td><div align="right">注册时填写的Email:</div></td>
<td>
<asp:TextBox ID="email" runat="server" Width="200px" ></asp:TextBox></td>
</tr>
<tr>
<td><div align="right">验证码:</div></td>
<td><table width="100%">
<tr>
<td align="left" valign="top" style="width: 64px"><asp:TextBox ID="txt_validcode" runat="server" Height="15px" Width="62px"></asp:TextBox> </td>
<td align="left" valign="top"><img id="yzm" src="../ValidateCode.aspx" /></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Button ID="Button1" runat="server" Text=" 找回密码 " /></td>
</tr>
</table> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>个人会员密码找回</title>
<link href="/style.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
// 检查 E-mail 否是已被注册
function CheckEmail()
{
var e = document.getElementById("email").value;
if(e != "")
{
if(!/(\S)+[@]{1}(\S)+[.]{1}(\w)+/.test(e))
{
alert("请入输式格准确的E-mail 址地!");
var email = document.getElementById ( "email" );
email.value = "";
email.focus ();
}
}
}
function checkAll()
{
var ee = document.getElementById("username").value;
if(ee == "")
{
alert('登录名称不能为空');
return false;
}
var e = document.getElementById("email").value;
if(e == "")
{
alert('Emial不能为空');
return false;
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table width="778" border="0" align="center" cellpadding="5" cellspacing="0" class="table_huang">
<tr>
<td colspan="2" class="TD_huang_14_write"> <span style="font-size: 11pt">>> 获得密码</span></td>
</tr>
<tr>
<td width="26"></td>
<td width="724"><table width="90%" border="0" cellspacing="2" cellpadding="5">
<tr>
<td width="23%"><div align="right">户用名:</div></td>
<td width="77%">
<asp:TextBox ID="username" runat="server" Width="150px" ></asp:TextBox></td>
</tr>
<tr>
<td><div align="right">注册时填写的Email:</div></td>
<td>
<asp:TextBox ID="email" runat="server" Width="200px" ></asp:TextBox></td>
</tr>
<tr>
<td><div align="right">验证码:</div></td>
<td><table width="100%">
<tr>
<td align="left" valign="top" style="width: 64px"><asp:TextBox ID="txt_validcode" runat="server" Height="15px" Width="62px"></asp:TextBox> </td>
<td align="left" valign="top"><img id="yzm" src="../ValidateCode.aspx" /></td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" style="text-align: center">
<asp:Button ID="Button1" runat="server" Text=" 找回密码 " /></td>
</tr>
</table> </td>
</tr>
</table>
</div>
</form>
</body>
</html>
端后码代
正所谓“学海无涯”。我们正像一群群鱼儿在茫茫的知识之海中跳跃、 嬉戏,在知识之海中出生、成长、生活。我们离不开这维持生活的“海水”,如果跳出这个“海洋”,到“陆地”上去生活,我们就会被无情的“太阳”晒死。
[csharp] view plaincopyprint?using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class ClientServer_Default2 : System.Web.UI.Page
{
string lspass = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Button1.Attributes.Add("onclick", "javascript:return checkAll();");
}
}
protected void Button1_Click(object sender, EventArgs e)
{
HttpCookie myCookie_validcode = Request.Cookies["FWCX_CheckCode"];
if (myCookie_validcode.Value.ToString() != txt_validcode.Text)
{
Response.Write("<script>");
Response.Write("alert('验证码错误')");
Response.Write("</script>");
return;
}
//首先判断该登录名称和email否是存在
string sql = "select * from t_users where u_username='" + username.Text.Trim() + "' and u_email='" + email.Text.Trim() + "' and u_class='0' and u_valid='1'";
DataTable dt = new DataTable();
//dt = new SQLTool().dataTable(sql);
if (dt.Rows.Count < 1)
{
Response.Write("<script>alert('登录名称或Email址地错误!,请从新填写后再试。');</script>");
}
else
{
//首先给在现的数据库t_users附上一个临时密码
//Response.Write(CreateRandomCode(8));
lspass = CreateRandomCode(8);
sql = "update t_users set u_getpwd='" + lspass + "' where u_username='" + username.Text.Trim() + "' and u_email='" + email.Text.Trim() + "' and u_class='0' and u_valid='1'";
//if (new SQLTool().ExecuteSql(sql) >= 0)
//{
sendEmail(email.Text.Trim(), username.Text.Trim());
Response.Write("<script>alert('临时密码已发送到您的注册Email中,请在下一页面中改修密码。');window.location.href='getpwdconfirm.aspx';</script>");
//}
}
}
public void sendEmail(string email, string name)
{
try
{
jmail.Message jmessage = new jmail.Message();
jmessage.Charset = "GB2312";
jmessage.From = "86085005@163.com";
// 发信址地
jmessage.MailServerUserName = "86085005";
//smtp认证户用名(注:如为网易户用,不加要@163.com,只要面前分部可即)
jmessage.MailServerPassWord = "kingseer";
// smtp论证户用名密码
jmessage.FromName = "108力人银行";
// 发信人
jmessage.ReplyTo = "86085005@163.com";
// 复兴址地
jmessage.C;//件邮容内为html
jmessage.Subject = "108力人银行临时密码";
string strbody = "";
strbody += new functions().getInfoXX("t_pagetexts", "p_name", "找回密码件邮反馈-个人", "p_value").Replace("$", name).Replace("@%", lspass);
jmessage.HTMLBody = strbody;
// 件邮标题
jmessage.AddRecipient(email, "", "");
jmessage.Send("smtp.163.com", false);//发送件邮smtp.163.com
jmessage.Close();//关闭对象,释放资源
}
catch (Exception err)
{
Response.Write(err);
}
}
/// <summary>
/// 功能:发生数字和字符混合的随机字符串
/// </summary>
/// <param name="codecount">字符串的个数</param>
/// <returns></returns>
private string CreateRandomCode(int codecount)
{
// 数字和字符混合字符串
string allchar = "0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l,m,n";
//分割成组数
string[] allchararray = allchar.Split(',');
string randomcode = "";
//随机数实例
System.Random rand = new System.Random(unchecked((int)DateTime.Now.Ticks));
for (int i = 0; i < codecount; i++)
{
//获得一个随机数
int t = rand.Next(allchararray.Length);
//合成随机字符串
randomcode += allchararray[t];
}
return randomcode;
}
}
文章结束给大家分享下程序员的一些笑话语录: 系统程序员
1、头皮经常发麻,在看见一个蓝色屏幕的时候比较明显,在屏幕上什幺都看不见的时候尤其明显;
2、乘电梯的时候总担心死机,并且在墙上找reset键;
3、指甲特别长,因为按F7到F12比较省力;
4、只要手里有东西,就不停地按,以为是Alt-F、S;
5、机箱从来不上盖子,以便判断硬盘是否在转;
6、经常莫名其妙地跟踪别人,手里不停按F10;
7、所有的接口都插上了硬盘,因此觉得26个字母不够;
8、一有空就念叨“下辈子不做程序员了”;
9、总是觉得9号以后是a号;
10、不怕病毒,但是很害怕自己的程序;