ÔÚASP.NETÖÐÏÂÔØÎļþ
//TransmitFileʵÏÖÏÂÔØ
protected void Button1_Click(object sender, EventArgs
e)
{
/*
΢ÈíΪResponse¶ÔÏóÌṩÁËÒ»¸öеķ½·¨TransmitFileÀ´½â¾öʹÓÃResponse.BinaryWrite
ÏÂÔس¬¹ý400mbµÄÎļþʱµ¼ÖÂAspnet_wp.exe½ø³Ì»ØÊÕ¶øÎÞ·¨³É¹¦ÏÂÔصÄÎÊÌâ¡£
´úÂëÈçÏ£º
*/
Response.ContentType = "application/x-zip-compressed";
Response.AddHeader("Content-Disposition",
"attachment;filename=z.zip");
string filename =
Server.MapPath("DownLoad/z.zip");
Response.TransmitFile(filename);
}
//WriteFileʵÏÖÏÂÔØ
protected void Button2_Click(object sender,
EventArgs e)
{
/*
using System.IO;
*/
string fileName = "asd.txt";//¿Í»§¶Ë±£´æµÄÎļþÃû
string filePath = Server.MapPath("DownLoad/aaa.txt");//·¾¶
FileInfo fileInfo = new FileInfo(filePath);
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.AddHeader("Content-Disposition",
"attachment;filename=" + fileName);
Response.AddHeader("Content-Length", fileInfo.Length.ToString());
&
Ïà¹ØÎĵµ£º
ʵÏÖASP.NETÉú³ÉËæ»úÃÜÂ빦ÄÜÊǺÜÈÝÒ׵ģ¬ÏÂÃæµÄ´úÂë¸ø³öÁËÍêÕûµÄʵÏÖ·½·¨£º
public static string MakePassWord(string PwdChars, int Pwdlen)
{
string mpstr = "";
int iRandNum;
Random mrnd = new Random();
for (int ......
ÔÚÏîÄ¿ÖÐÎÒÒªÓõ½ÐÞ¸ÄÃÜÂ빦ÄÜ£¬ÐÞ¸ÄÃÜÂëÒ³ÎÒÊÇÓÃģʽ¶Ô»°¿òµÄÐÎʽµ¯³öÀ´µÄ£¬µ±ÎÒ°´Õý³£Çé¿öÌá½»Êý¾Ýʱ£¬·¢ÏÖËü»áµ¯³öÒ»¸öеĴ°¿ÚÀ´ÏÔʾÐ޸ijɹ¦ÐÅÏ¢£¬ÎÒÏëÌá½»Êý¾Ý¶ø²»´ò¿ªÐ´°¿Ú£¬
ÎҵĽâ¾ö°ì·¨¾ÍÊÇÔÚhead±êÇ©ÖмÓÉÏbase±êÇ©ÈÃtarget="_self",֮ǰÎÒÏëµÃÓе㸴ÔÓ£¬Ïë¸øËüÒ»¸ö¹Ì¶¨µÄalert£¬µ±³É¹¦ÐÞ¸Äʱ²ÅÏÔʾ ......
People often ask me for guidance on how they can dynamically "re-write" URLs and/or have the ability to publish cleaner URL end-points within their ASP.NET web applications. This blog post summarizes a few approaches you can take to cleanly map or rewrite URLs with ASP.NET, and have th ......
[ת]asp.net ĸ°æҳʹÓÃÏê½â
ĸ°æÒ³£¨À©Õ¹ÃûÊÇ.master£©
ËüµÄʹÓøúÆÕͨµÄÒ³ÃæÒ»Ñù£¬¿ÉÒÔ¿ÉÊÓ»¯µÄÉè¼Æ£¬Ò²¿ÉÒÔ±àдºóÖôúÂë¡£ÓëÆÕͨҳÃæ²»Ò»ÑùµÄÊÇ£¬Ëü¿ÉÒÔ°üº¬ContentPlaceHolder¿Ø¼þ£¬ContentPlaceHolder¿Ø¼þ¾ÍÊÇ¿ÉÒÔÏÔʾÄÚÈÝÒ³ÃæµÄÇøÓò¡£
´úÂëÈçÏ£º
<%@ Master Language="C#" AutoEventWireup="true" CodeFile=" ......
PHP VS ASP.NET
²©¿Í·ÖÀà: ÊÕ»ñ»ýÀÛ
bruce·¢±íÓÚËÄÔ 14 2009, 04:42 ÏÂÎç
PHPºÍASP.NETÔÚ±¾ÖÊÉÏÊÇÓкܴó²»Í¬µÄ£¬PHP³£±»Ó¦Óõ½¹¦Ä̶ܹ¨µÄÍøÕ¾¹¹½¨ÉÏ£¬ÀýÈçÁôÑÔ°å¡¢ÐÂÎÅ·¢²¼¡¢ÂÛ̳ºÍͶƱµÈ£¬ÕâЩ¹¦ÄÜÊÇ¿ìËÙ½¨Õ¾±Ø±¸µÄ£¬×Ô¶¨Ò帴ÔÓµÄÉÌÒµÁ÷³Ì²»¶à£¬Òò´ËÍø·ÉÏÓÐÐí¶àÏֳɵ ......