Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

asp.net Ö±½Ó ´ÓÊý¾Ý¿â ÏÂÔØ Îļþ

µ±ÎÒÃÇÏëÒª´ÓÍøÉÏÏÂÔØÎļþʱ£¬Í¨³£µÄ×ö·¨ÊÇÔÚ·þÎñÆ÷ÉϵÄij¸öĿ¼ÏÂÉú³ÉÒ»¸öÎļþ¡£
protected void DownloadFile(string filename)
{
string saveFileName = "test.xls";
int intStart = filename.LastIndexOf("\\") + 1;
saveFileName = filename.Substring(intStart, filename.Length - intStart);
Response.Clear();
Response.Charset = "utf-8";
Response.Buffer = true;
this.EnableViewState = false;
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AppendHeader("Content-Disposition", "attachment;filename=" + saveFileName);
Response.WriteFile(filename);
Response.Flush();
Response.Close();
Response.End();

µ«»á´æÔÚÕâÑùµÄÇé¿ö£¬Ö±½Ó´ÓÊý¾Ý¿âÖÐÏÂÔØͼƬ¡£
ÆäʵԭÀíºÜ¼òµ¥¡£¾ÍÊÇÓÃMemoryStream´úÌæFileStream¡£ÓÐÒ»µãÐèҪעÒâ¾ÍÊÇhttpÍ·µÄ¸ñʽҪÉèÖÃÕýÈ·¡£ byte[] pic = //´ÓÊý¾Ý¿â·µ»ØµÄͼƬ
MemoryStream ms = new MemoryStream(pic);
System.Drawing.Image img = null;
Graphics g =null;
try
{
img = new Bitmap(new MemoryStream(pic));
g= Graphics.fromImage(img);
Font objfont = new Font("Verdana", 12, FontStyle.Bold);
Brush objbrush = Brushes.Red;
Rectangle rect = new Rectangle(150, 550, 200, 50);
g.DrawString("Ìí¼ÓÎÄ×Ö", objfont, objbrush, rect);
img.Save(ms, ImageFormat.Bmp);
}
catch { }
finally
{
if (img != null) img.Dispose();
if (g!= null) g.Dispose();
}
byte[] newbmp = ms.ToArray();
ms.Close();
ms = new MemoryStream(newbmp);
Response.Clear();
Response.AddHeader("Content-type", "binary/octet-stream");
Response.AddHeader("Content-Length", pic.Length.ToString());
Response.AddHeader("Content-Disposition", "attachment; filename="+pic.Length.ToString()+".bmp; size=" + pic.Length.ToString());


Ïà¹ØÎĵµ£º

ASP.NETÖÐMD5ºÍSHA1¼ÓÃܵļ¸ÖÖ·½·¨

MD5µÄÈ«³ÆÊÇMessage-Digest Algorithm 5£¨ÐÅÏ¢-ÕªÒªËã·¨£©£¬ÔÚ90Äê´ú³õÓÉMit Laboratory for Computer ScienceºÍRsa data security incµÄRonald l. rivest¿ª·¢³öÀ´£¬¾­md2¡¢md3ºÍmd4·¢Õ¹¶øÀ´¡£ËüµÄ×÷ÓÃÊÇÈôóÈÝÁ¿ÐÅÏ¢ÔÚÓÃÊý×ÖÇ©ÃûÈí¼þÇ©Êð˽ÈËÃܳ×Ç°±»"ѹËõ"³ÉÒ»ÖÖ±£Ãܵĸñʽ£¨¾ÍÊÇ°ÑÒ»¸öÈÎÒⳤ¶ÈµÄ×Ö½Ú´®±ä»»³ÉÒ»¶¨³¤µÄ´óÕ ......

Asp.Net´óÐÍÏîĿʵ¼ù ¹Ø¼ü¼¼Êõ·½°¸Ñ¡ÔñÀíÓɼ°Ë¼Â·

ËäÈ»ÎÒ²»Ï²»¶ÌÖÂÛÌ«¶àÀíÂÛ¸ÅÄîÉϵĶ«Î÷£¬µ«¸÷λ“ש¼Ò”»¹ÊÇÌá³öÁ˺ܶà·Ç³£ÓÐÕë¶ÔÐÔµÄÒâ¼û£¬Íû´ËÌû²»Òª³ÉΪ¿Úˮս²ÅºÃ....ÏÖ´ðÒÉÈçÏ£¨Óкܶà¸öÈËÀí½â£¬²»Ò»¶¨ÕýÈ·£©£º
ש¼ÒÒâ¼ûÇë²Î¼û£ºAsp.Net´óÐÍÏîĿʵ¼ùϵÁе¼º½
ΪʲôѡÔñNHibernate
ÀíÓÉ1£º¶ÔÏó¹ØϵӳÉä¼¼Êõ£¨ORM£©µÄ×îÖ÷ҪĿµÄÊÇΪÁ˽â¾ö¹ØϵÐÍÊý¾Ý¿âÓ ......

ASP.NET MVC ÈëÃÅ3¡¢Routing

ÔÚÒ»¸ö
route
ÖУ¬Í¨¹ýÔÚ´óÀ¨ºÅÖзÅÒ»¸öռλ·ûÀ´¶¨Òå
(
{ and } )
¡£µ±½âÎö
URL
µÄʱºò£¬·ûºÅ
"/"
ºÍ
"."
±»×÷Ϊһ¸ö¶¨Òå·ûÀ´½âÎö£¬¶ø¶¨Òå·ûÖ®¼äµÄÖµÔòÆ¥Å䵽ռλ
·ûÖС£
route
¶¨ÒåÖв»ÔÚ´óÀ¨ºÅÖеÄÐÅÏ¢Ôò×÷Ϊ³£Á¿Öµ¡£
ÏÂÃæÊÇһЩʾÀý
URL
£º

Valid route definitions
Example ......

asp.net »ñµÃ·¾¶

²âÊÔµÄurlµØÖ·ÊÇhttp://www.test.com/testweb/default.aspx,   ½á¹ûÈçÏ£º  
  Request.ApplicationPath:   /testweb  
  Request.CurrentExecutionFilePath:   /testweb/default.aspx  
  Request.FilePath:   /testweb/defa ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ