扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:阿虎 来源:yesky 2007年10月26日
关键字: Windows
<script runat="server"> protected void Post_Form(object sender, EventArgs e) { file://判断姓名和电子邮件地址是否填入 if(Name.Value!=""&&Email.Value!="") { file://发送电子邮件 System.Web.Mail.SmtpMail.Send(Email.Value, "majinhu@yesky.com", "Mail From:"+Name.Value,Message.Value); } } </script> |
using System; using System.Web.UI; using System.Web.UI.HtmlControls; public class First:Page { file://声明使用的组件 protected HtmlInputControl Name, Email; protected HtmlTextArea Message; public void Post_Form(object sender, EventArgs e) { file://判断姓名和电子邮件地址是否填入 if(Name.Value!=""&&Email.Value!="") { file://发送电子邮件 System.Web.Mail.SmtpMail.Send(Email.Value,"majinhu@yesky.com", "Mail From:"+Name.Value,Message.Value); } } } |
<%@ Page Language="C#" Inherits="First" Src="send.cs" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>New Page 1</title> </head> <body> <h3>欢迎进入Code Behind设计界面</h3> <form runat="server"> <table border="1" width="100%"> <tr> <td width="100%" colspan="2">请填入下列各项</td> </tr> <tr> <td width="35%">姓名</td> <td width="65%"> <input type="text" id="Name" name="Name" size="20" runat="server" /> </td> </tr> <tr> <td width="35%">电子邮件地址</td> <td width="65%"> <input type="text" id="Email" name="Email" size="20" runat="server" /> </td> </tr> <tr> <td width="35%">内容</td> <td width="65%"><textarea rows="7" id="Message" name="Message" cols="26" runat="server"> </textarea></td> </tr> <tr> <td width="100%" colspan="2"> <input type="submit" value="Submit" id="B1" name="B1" OnServerClick="Post_Form" runat="Server" /> </td> </tr> </table> </form> <p> </p> </body> </html> |
濠碘€冲€归悘澶愬箖閵娾晜濮滈悽顖涚摃閹烩晠宕氶崶鈺傜暠闁诡垰鍘栫花锛勬喆椤ゅ弧濡澘妫楅悡娆撳嫉閳ь剟寮0渚€鐛撻柛婵呮缁楀矂骞庨埀顒勫嫉椤栨瑤绻嗛柟顓у灲缁辨繈鏌囬敐鍕杽閻犱降鍨藉Σ鍕嚊閹跺鈧﹦绱旈幋鐐参楅柡鍫灦閸嬫牗绂掔捄铏规闁哄嫷鍨遍崑宥夋儍閸曨剚浠樺ù锝嗗▕閳ь剚鏌ㄧ欢鐐寸▕鐎b晝顏遍柕鍡嫹
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者