ÔÚ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 ......
ÄÚÈÝÒ³·ÃÎÊMasterPageÖеĿؼþ,ÓÐÁ½ÖÖ½â¾ö·½°¸£º
Ò»¡¢ÊÇÓÃÈõÀàÐÍ·ÃÎÊ
ʹÓà FindControl ·½·¨»ñȡģ°åÒ³µÄ¿Ø¼þ
((Label)Master.FindControl("Label1")).Text = "xxx";
¶þ¡¢¸øÄ£°åÒ³Ìí¼ÓÊôÐÔÀ´Ê¹ÓÃÇ¿ÀàÐÍ·ÃÎÊ£¨ÍƼö£©
Ä£°åÒ³¶¨Ò壻
&nb ......
ÔÚÏîÄ¿ÖÐÎÒÒªÓõ½ÐÞ¸ÄÃÜÂ빦ÄÜ£¬ÐÞ¸ÄÃÜÂëÒ³ÎÒÊÇÓÃģʽ¶Ô»°¿òµÄÐÎʽµ¯³öÀ´µÄ£¬µ±ÎÒ°´Õý³£Çé¿öÌá½»Êý¾Ýʱ£¬·¢ÏÖËü»áµ¯³öÒ»¸öеĴ°¿ÚÀ´ÏÔʾÐ޸ijɹ¦ÐÅÏ¢£¬ÎÒÏëÌá½»Êý¾Ý¶ø²»´ò¿ªÐ´°¿Ú£¬
ÎҵĽâ¾ö°ì·¨¾ÍÊÇÔÚhead±êÇ©ÖмÓÉÏbase±êÇ©ÈÃtarget="_self",֮ǰÎÒÏëµÃÓе㸴ÔÓ£¬Ïë¸øËüÒ»¸ö¹Ì¶¨µÄalert£¬µ±³É¹¦ÐÞ¸Äʱ²ÅÏÔʾ ......
VS2005µ÷ÊÔasp.net³ÌÐòʱ³öÏÖ----Internet Explorer ÎÞ·¨ÏÔʾ¸ÃÒ³Ãæ
ÈçͼËùʾ£º
ǰ¶Îʱ¼ä¿ÉÒÔµ÷ÊԵģ¬ËÖª×òÍíͻȻ²»ÐÐÁË£¬ÕÒÁ˺þã¬ÖÕÓÚÕÒµ½½â¾ö·½°¸¡£ÓõÄÊÇVS2005£¬Îļþϵͳ£¬ÔÚIISÀïÃæÉèÖõϰ£¬¿ÉÒÔÔËÐУ¬´úÂëûÎÊÌ⣬Êý¾Ý¿âÁ¬½ÓûÎÊÌâ¡£
·½°¸Ò»£ºÍ¨¹ýÓÒ»÷ASP.NET Development Server£¬Èçͼ£º
´ò¿ª1£¬ÔÚĬÈÏä¯ÀÀÆ ......
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ·
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ·
///
/// È¡µÃdataset
//
/// ²éѯÓï¾ä
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......