Asp.NetÎļþÉÏ´«
ÓÃAsp.NetÉÏ´«Îļþ,Ê×Óõ½µÄÊÇFileUpload¿Ø¼þ
<asp:FileUpload ID="FileUpload1" runat="server" /><br />
<asp:Button ID="btn" runat="server" Text="È·¶¨" OnClick="btn_Click"/>
C#´úÂë
protected void btn_Click(object sender, EventArgs e)
{
//ÅжÏÊÇ·ñÑ¡ÔñÁËÎļþ
if (this.FileUpload1.HasFile)
{
try{
//»ñÈ¡Îļþ
HttpPostedFile filename = this.FileUpload1.PostedFile;
//ÅжÏÎļþ´óС,×Ö½ÚΪµ¥Î»
if (filename.ContentLength>0)
{
FileUpload1.SaveAs(@"D:\" + FileUpload1.FileName);
s_alert("ÉÏ´«³É¹¦");
}
}
catch (Exception ex)
{
s_alert ("ÉÏ´«Ê§°Ü,³öÏÖ´íÎó");
}
}
else
{
s_alert("Ä㻹ûÓÐÑ¡ÔñÎļþ");
}
}
public static void s_alert(string str)
{
Page page = (Page)HttpContext.Current.Handler;
page.ClientScript.RegisterStartupScript(page.GetType(), Guid.NewGuid().ToString(), "alert('" + str + "');", true);
}
Ïà¹ØÎĵµ£º
Óö¼û¹ýÕâÑùµÄÎÊÌ⣬ºÜÆæ¹Ö£¬¾ÍÊÇ asp.net button°´Å¥onclickʼþ´¥·¢²»ÁË£¬
µã»÷û·´Ó¦£¬È»ºóÔÚÍøÉϲéÁËЩ×ÊÁÏ£¬·¢ÏÖÒ»¸ö˵·¨£¬“Ò»°ãÀ´ËµÊÇ¿Í»§¶ËÔ´´úÂëÖÐÓжà¸öform±êʶ£¬»á³öÏÖÕâÖÖÇé¿ö”
ÓÚÊǾͲ鿴×Ô¼ºµÄÒ³Ãæ´úÂ룬ÕæµÄÓÐÁ½¸öform£¬È¥µôÒ»¸öºó£¬¾ÍÕý³£À²£¬
ÖÁÓÚ ÕâÖÖÇé¿ö£¬Ôڴ˼ÇÏÂÀ´£¬×÷¸öѧϰµÄÒ»¸öÐ¡Ö ......
ASP.NET
ʹÓÃÎÞCookieµÄ±íµ¥ÈÏ֤Ʊ¾Ý
ĬÈÏÇé¿öÏ£¬forms authentication system½«¾ö¶¨Êǽ«Æ±¾Ý´æ´¢ÔÚcookies
collectionÀﻹÊDzåÈëÓû§·ÃÎÊÒ³ÃæµÄURLÀï¡£ËùÓÐÖ÷Á÷µÄ×ÀÃæä¯ÀÀÆ÷£¬±ÈÈçInternet
Explorer£¬Firefox£¬Opera£¬»òSafari¶¼Ö§³Öcookies£¬µ«²¢·ÇËùÓеÄÒƶ¯É豸¶¼Ö§³Ö¡£
forms authentication systemʹÓúÎÖÖco ......
µ¼³öµ½excelµÄ·½·¨ÓжàÖÖ£¬±È½Ï³£¼ûµÄÊÇÖ±½Óµ¼³öµ½EXCEL,»¹ÓоÍÊÇÏȽ«Ò³ÃæµÄÊý¾Ýдµ½´ÅÅÌÎļþ£¬Ö®ºóÖ±½ÓÔÙ´ò¿ªÎļþ£¬ÁíÍ⻹ÓоÍ
ÊǽèÖúµÚÈý·½µÄ¿Ø¼þ¡£
Ç°¶Îʱ¼äдµÄµ¼³öÊý¾Ýµ½excelÔÚexcel2003ÖÐÕý³£¶øÔÚexcel2007ÖÐÊý¾ÝÂÒÂ룬½ñÌìÁ˽⵽ÔÀ´ÊÇResponse.ContentType = "application/ms-excel";µ¼Öµģ¬¸ÄΪR ......
ÔÚÁ˽âHTTP¶ÏµãÐø´«µÄÔÀí֮ǰ£¬ÏÈÀ´ËµËµHTTPÐÒ飬HTTPÐÒéÊÇÒ»ÖÖ»ùÓÚtcpµÄ¼òµ¥ÐÒ飬·ÖΪÇëÇóºÍ»Ø¸´Á½ÖÖ¡£ÇëÇóÐÒéÊÇÓÉ¿Í»§»ú(ä¯ÀÀÆ÷)Ïò·þÎñÆ÷£¨WEB SERVER£©Ìá½»ÇëÇóʱ·¢Ëͱ¨ÎĵÄÐÒé¡£»Ø¸´ÐÒéÊÇÓÉ·þÎñÆ÷(web server)£¬Ïò¿Í»§»ú(ä¯ÀÀÆ÷)»Ø¸´±¨ÎÄʱµÄÐÒé¡£ÇëÇóºÍ»Ø¸´ÐÒ鶼ÓÉÍ·ºÍÌå×é³É¡£Í·ºÍÌåÖ®¼äÒÔÒ»ÐпÕÐÐΪ·Ö¸ô¡£
......