try
{
conn.Open ();
cmd.ExecuteNonQuery ();
Session["userID"]=this.txtRegUserName.Text ;
MailMessage sendmail = new MailMessage();
sendmail.To = this.txtEmail.Text.ToString();
sendmail.From = "[email protected]";
sendmail.Subject = "密码找回";
string MailText = "尊敬的cacool用户,您好!";
MailText+="\n这是系统发出的你的用户帐号:";
MailText+="\n\n用户名:"+Session["userID"].ToString();
MailText+="\n密码:"+password;
sendmail.Body=MailText;
SmtpMail.Send(sendmail);
Response.Write("<script language='javascript'> alert('恭喜您注册成功!请登录!');window.location.href='index.aspx'; </script>");
}
catch(System.Exception ex)
{
throw new Exception (ex.Message );
}
finally
{
conn.Close ();
}程序运行后显示:未能访问“CDO.Message”对象。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Exception: 未能访问“CDO.Message”对象。源错误:
行 170: catch(System.Exception ex)
行 171: {
行 172: throw new Exception (ex.Message );
行 173: }
行 174: finally
这是什么问题,请大家帮忙看看
{
conn.Open ();
cmd.ExecuteNonQuery ();
Session["userID"]=this.txtRegUserName.Text ;
MailMessage sendmail = new MailMessage();
sendmail.To = this.txtEmail.Text.ToString();
sendmail.From = "[email protected]";
sendmail.Subject = "密码找回";
string MailText = "尊敬的cacool用户,您好!";
MailText+="\n这是系统发出的你的用户帐号:";
MailText+="\n\n用户名:"+Session["userID"].ToString();
MailText+="\n密码:"+password;
sendmail.Body=MailText;
SmtpMail.Send(sendmail);
Response.Write("<script language='javascript'> alert('恭喜您注册成功!请登录!');window.location.href='index.aspx'; </script>");
}
catch(System.Exception ex)
{
throw new Exception (ex.Message );
}
finally
{
conn.Close ();
}程序运行后显示:未能访问“CDO.Message”对象。
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.Exception: 未能访问“CDO.Message”对象。源错误:
行 170: catch(System.Exception ex)
行 171: {
行 172: throw new Exception (ex.Message );
行 173: }
行 174: finally
这是什么问题,请大家帮忙看看
解决方案 »
- 诚恳请教:页面循环显示时控件参数的设置及触发事件的问题
- 权限问题 在线等啊~!!!!!
- 一个简单的SQL语句问题!!!!!!!!!!
- 我现在有20+个网站须要发布已经有申请好相应的域名了,每一个网站都不大于10M用什么方法发布到Internet最好呢
- 如何连接数据库
- 用asp.net怎么实现幻灯片效果
- 一个论坛程序,所有论坛配置信息,都放在一个数据库表中
- [C#]RowFilter問題
- Default.aspx的页面怎样和他的Default.aspx.cs窗体的代码交互?
- c# .net 怎么做 滚动公告 呀 ?请赐教
- datagrid处于编辑状态时算column号问题(有些column设置为readonly)
- 求助。NET的变态问题。
{
MailMessage mail = new MailMessage();
mail.To = "[email protected]";
mail.From = "[email protected]";
mail.Subject = "this is a test email.";
mail.Body = "Some text goes here";
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1"); //basic authentication
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "user"); //set your username here
mail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "password"); //set your password here SmtpMail.SmtpServer = "mail.163.com"; //your real server goes here
SmtpMail.Send( mail );
}
程序运行一直没有反应,怎么回事呢?