ÓÃasp.netʵÏֵİѱ¾ÎÄÍƼö¸øºÃÓѹ¦ÄÜ
///<summary>
///<author>·ÉÓ¥@ASPCool.com</author>
///<description>±¾ÎÄÓÃasp.netʵÏÖ°Ñ´ËÎÄÍƼö¸øºÃÓѵŦÄÜ¡£</desciption>
///<copyright>ASP¿á¼¼Êõ×ÊѶÍø(www.ASPCool.com)</copyright>
///</summary>
ÕâÀï·ÉÓ¥ÓÃÒ»¸ö¼òµ¥µÄÀý×ÓÏò´ó¼Ò½éÉÜÈçºÎʹÓÃasp.netµÄÓʼþ·¢Ë͹¦ÄÜ¡£Ê×ÏÈ£¬ÎÒÃÇÏÈ×öÒ»¸ö·¢ËͽçÃæ¡£tuijian.asp, ÆäÖÐtitleÊÇ´ú±íÎÄÕµıêÌ⣬id´ú±íÎÄÕµıàºÅ¡£
<html>
<body>
ÄúºÃ£¬»¶ÓʹÓÃASP¿á¼¼Êõ×ÊѶÍøÎÄÕÂÍƼö¹¦ÄÜ£¬ÄúÍƼöµÄÎÄÕÂΪ£º¡¶<%=request("title")%>¡·.<BR>
<form action="mail.aspx">
ÄúµÄÐÅÏ䣺<INPUT TYPE="text" NAME="sender"><BR>
ÊÕ¼þÈËÐÅÏ䣺<INPUT TYPE="text" NAME="accepter"><BR>
<INPUT TYPE="hidden" name="title" value="<%=request("title")%>">
<INPUT TYPE="hidden" name="id" value="<%=request("id")%>">
<INPUT TYPE="submit" value="·¢ËÍ"><INPUT TYPE="reset" value="ÖØд">
</form>
</body>
</html>
ÏÂÃæÎÒÃǾÍÓÃasp.netÀ´ÊµÏÖÍƼöÎÄÕ¹¦ÄÜ£¬mail.aspx
<% @Page Language="C#" Debug="true"%>
<% @Import Namespace="System.Web.Mail" %>
<%
MailMessage msgMail = new MailMessage();
msgMail.To = Request["accepter"]; //Óʼþ½ÓÊÜÕß
msgMail.Cc = "webmaster@aspcool.com";
msgMail.from = Request["sender"];
msgMail.Subject = "ÄúµÄÅóÓÑ´ÓASPCOOL.COM¸øÄúÍƼöÁËһƪÎÄÕ¡£";
msgMail.BodyFormat = MailFormat.Html;
string strBody = "<html><body><b>" + Request["accepter"] +"</b>,ÄúºÃ¡£<br>" +
"ÄúµÄÅóÓÑ: <font color=\"red\">"+ Request["sender"]+ "</font>´Ó<a href=http://www.21asp.net>21asp.net<
Ïà¹ØÎĵµ£º
ÔÎÄ£ºÁõÎä|ÔÚasp.net webserviceÖÐÈçºÎʹÓÃsession
ÔÚʹÓÃasp.net±àдwebserviceʱ£¬Ä¬ÈÏÇé¿öÏÂÊDz»Ö§³ÖsessionµÄ£¬µ«ÎÒÃÇ¿ÉÒÔ°ÑWebMethodµÄEnableSessionÑ¡ÏîÉèΪtrueÀ´ÏÔʽµÄ´ò¿ªËü£¬Çë¿´ÒÔÏÂÀý×Ó£º
1 н¨ÍøÕ¾WebSite
2 н¨web·þÎñWebService.asmx£¬Ëü¾ßÓÐÒÔÏÂÁ½¸ö·½·¨£º
C#-Code:
[WebMe ......
ÔÎÄ£ºÁõÎä|ASP.NETÖÐÔÚµã»÷°´Å¥ºó½«¸Ã°´Å¥ÉèΪ²»¿ÉÓõÄÈô¸ÉÇé¿ö
ÏîÄ¿Öо³£³öÏÖÓû§Öظ´Ìá½»µÄÇé¿ö£¬ÎªÁË·ÀÖ¹ÕâÖÖÇé¿ö£¬×î³£Óõķ½·¨¾ÍÊÇÔÚÓû§µã»÷°´Å¥ºó½«¸Ã°´Å¥ÉèΪ²»¿ÉÓ㬱ÊÕßÔÚʵ¼Ê¿ª·¢µ±ÖÐÓöµ½Á˶àÖÖ²»Í¬µÄÇé¿ö£¬ÔÚ´Ë×ö¸öС½á£¬ÒÔ¹©²Î¿¼¡£
µÚÒ»ÖÖÇé¿öÊÇ·ÇsubmitÀàÐ͵İ´Å¥
ÕâÖÖÇé¿ö±È½Ï¼òµ¥£¬Ö»ÒªÔÚ¿Í»§¶ËÌí¼ÓÊ ......
template.htmÄ£°åÒ³Ô´Âë:
1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2. <html xmlns="http://www.w3.org/1999/xhtml" >
3. <head>
4. <title ......
ASP.NET 2.0 ÖÐÐÂÔö¼ÓÁË Theme µÄ¹¦ÄÜ£¬ËüµÄ³öÏÖÄÜÈÃÍøվʵÏÖ»»·ô¸ü¼ÓÈÝÒס£
Theme µÄʵÏÖ°üÀ¨£ºCSS¡¢Skin¡¢MasterPage¡£
CSS ÊÇÓÃÓÚ¿ØÖÆËùÓÐ HTML ±ê¼ÇµÄÍâ¹Û¡£
Skin ÊÇÓÃÓÚ¿ØÖÆËùÓÐ ASP.NET ·þÎñÆ÷µ÷ÕûµÄÍâ¹Û£¬²¢ÇÒ¿ÉÒÔͨ¹ýÊôÐÔ cssClass ¶¨ÒåËüµÄ CSS Ñùʽ¡£
MasterPage ÊÇ *.aspx Ò³ÃæÄ£°æ£¬²»¹ýËüûÓỶ¨Òåµ½ The ......
£¼input id = " loFile " type = " file " runat = " server " £¾
£¼form method = " post " enctype =" multipart/form-data " runat = " server "£¾
£¼/form £¾
1.»ñµÃÉÏ´«ÎļþµÄÃû³Æ£º£¨¹Ø¼üÊÇPostedFileÀàµÄÓ¦Óã©
ʹÓÃPathÀàÖеÄGetFileName·½·¨£¬¾ßÌåÈçÏ£º
lstrFileName = loFile.PostedFile.FileName
......