asp.netʵÏÖÎļþÏÂÔØ(wapÊÖ»úÏÂÔØ)
Õâ¸öÎÊÌâÀ§ÈÅÁËÎÒÁ½Ì죬ÊÖ»úÏÂÔØ
protected void Page_Load(object sender, EventArgs e)
{
string filename = Server.UrlDecode(Request["upload"]);
string filePath = Server.MapPath("upload/" + filename);//·¾¶
FileDownload(filePath);
}
/// <summary>
/// ÎļþÏÂÔØ
/// </summary>
/// <param name="FullFileName"> </param>
private void FileDownload(string FullFileName)
{
try
{
FileInfo DownloadFile = new FileInfo(FullFileName);
if (DownloadFile.Exists)
{
Response.Clear();
Response.ClearHeaders();
Response.Buffer = false;
//Response.ContentType = "application/octet-stream";//֪ͨä¯ÀÀÆ÷ÏÂÔØÎļþ¶ø²»ÊÇ´ò¿ª
Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(DownloadFile.FullName, System.Text.Encoding.UTF8));
Response.AppendHeader("Content-Length", DownloadFile.Length.ToString());
&nb
Ïà¹ØÎĵµ£º
ÔÚWeb±à³Ì¹ý³ÌÖУ¬´æÔÚןܶలȫÒþ»¼¡£±ÈÈçÔÚÒÔÇ°µÄASP°æ±¾ÖУ¬CookieΪ·ÃÎÊÕߺͱà³ÌÕ߶¼ÌṩÁË·½±ã£¬²¢Ã»ÓÐÌṩ¼ÓÃܵŦÄÜ¡£´ò¿ªIEä¯ÀÀÆ÷£¬Ñ¡Ôñ“¹¤¾ß”²Ëµ¥ÀïµÄ“InternetÑ¡Ï¬È»ºóÔÚµ¯³öµÄ¶Ô»°¿òÀïµ¥»÷“ÉèÖÔ°´Å¥£¬Ñ¡Ôñ“²é¿´Îļþ”°´Å¥£¬ÔÚµ¯³öµÄ´°¿ÚÖУ¬¾Í»áÏÔʾӲÅÌÀï ......
ÏÞÉèÖÃÒÔWindows Server 2003ΪÀý£¬ÐéÄâÖ÷»úÓû§²»±Ø½øÐдËÏîÉèÖá£Ê×ÏÈ£¬ÎÒÃÇÐèÒªÓõ½ÒÔϵÄ×é:
IIS_WPG ×飨Ҳ³ÆΪ IIS ¹¤×÷½ø³Ì×飬IIS Worker Process Group£©
Guests×é £¨À´±ö×飬ÔÚϵͳÖÐÓµÓÐ×îÉÙµÄȨÏÞ£©
ÒÔ¼°ÒÔϵÄÕʺÅ:
Internet À´±öÕÊ»§ £¨ÄäÃû·ÃÎÊ Internet ÐÅÏ¢·þÎñµÄÄÚÖÃÕÊ»§£©
Æô¶¯ IIS ½ø³ÌÕÊ»§ £¨ÓÃÓ ......
{0:d} YY-MM-DD
{0:p} °Ù·Ö±È00.00%
{0:N2} 12.68
{0:N0} 13
{0:c2} $12.68
{0:d} 3/23/2003
{0:T} 12:00:00 AM
{0:ÄÐ;;Å®}
DataGrid-Êý¾Ý¸ñʽÉèÖñí´ïʽ
Êý¾Ý¸ñʽÉèÖñí´ïʽ
.NET Framework ¸ñʽÉèÖñí´ïʽ£¬ËüÔÚÊý¾ÝÏÔʾÔÚÁÐÖÐ֮ǰÏÈÓ¦ÓÃÓÚÊý¾Ý¡£´Ë±í´ïʽÓÉ¿ÉÑ¡¾²Ì¬Îı¾ºÍÓÃÒÔϸñʽ± ......
ÄãÖ»ÒªÔÚWeb,configÎļþµÄ system.web ÅäÖýÚÏÂÌí¼ÓÒÔÏÂÅäÖãº
<globalization requestEncoding="GB2312" responseEncoding="GB2312"/>
µ±È»£¬ÄãÒ²¿ÉÒÔ½«“GB2312”¸ÄΪϵͳĬÈϵēUTF-8”£¬Ö»Òª¼ÓÉÏÕâÒ»ÅäÖã¬Ò³Ãæ¼ä´«ÖµµÄÂÒÂëÎÊÌâ¾Í½â¾öÁË¡£ ......