asp.net¶¯Ì¬Ìí¼ÓͼƬˮӡ
web.config
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
<add verb="*" path="images/shangjia/*/*.jpg" type="CoverHandler"/>
<add verb="*" path="images/shangjia/*/*/*.jpg" type="CoverHandler"/>
<add verb="*" path="admin/TotalUpImg/VedioImg/*.jpg" type="CoverHandler1"/>
</httpHandlers>
CoverHandler.cs
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
/// <summary>
/// CoverHandler µÄժҪ˵Ã÷
/// </summary>
public class CoverHandler : IHttpHandler
{
public CoverHandler()
{
//
// TODO: ÔÚ´Ë´¦Ìí¼Ó¹¹Ô캯ÊýÂß¼
//
}
private const string WATERMARK_URL = "~/images/WaterMark.png";
private const string DEFAULTIMAGE_URL = "~/images/default.jpg";
#region IHttpHandler ³ÉÔ±
public void ProcessRequest(HttpContext context)
{
System.Drawing.Image Cover;
if (File.Exists(context.Request.PhysicalPath))
{
Cover = Image.fromFile(context.Request.PhysicalPath);
Image watermark = Image.fromFile(context.Request.MapPath(WATERMARK_URL));
Graphics g = Graphics.fromImage(Cover);
Random r = new Random();
int width = r.Next(10,Cover.
Ïà¹ØÎĵµ£º
Ö±½ÓÖØдRenderʼþ
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
StringWriter sw = new StringWriter() ;
&nb ......
ÍøÕ¾ÎļþÃû£º
1¡¢ ÍøÕ¾ÎļþÃûÒÔ±ê×¼Ó¢Îĵ¥´ÊÃèÊöÒµÎñÄÚÈÝ¡£Èç¹û1¸öÓ¢Îĵ¥´ÊÎÞ·¨ÃèÊö£¬¿ÉÒÔÔö¼Ó2¸ö»òÕß3¸ö£¬µ«¾¡Á¿ÎªÍêÈ«µ¥´Ê£¬ÀýÈçarticle.aspx/ articleView.aspx / articleList.aspx µÈ¡£
2¡¢ ÎļþÃû¾¡Á¿²»ÓÃÊý×ÖÃèÊö¡£
3¡¢ ÎļþÃû¾¡Á¿²»ÄÜÌ«³¤£¬ÒÔ²»³¬¹ý20¸ö×ÖĸΪÒË¡£
4¡¢ ͼƬÎļþÃû¾¡Á¿ÃèÊöÍ ......
asp.netÖг£ÓõÄ26¸öÓÅ»¯ÐÔÄܵķ½·¨
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄ ......
ASP.NETÖеÄÈý²ã½á¹¹·ÖΪ±íʾ²ã£¨UI£©£¬ÒµÎñÂß¼²ã£¨BLL£©£¬Êý¾Ý·ÃÎʲ㣨Models£¬DAL£¬IDAL,DALFactory£¬DB£©£¬ÏÂÃæÎÒÀ´ËµËµÎÒ¶ÔѧϰÈý²ã½á¹¹µÄÔËÓá£
Ê×ÏÈÎÒ¸ø´ó¼Ò˵˵ÕâÈý²ã¶¼ÊÇʲôÒâ˼¡£
1. ±íʾ²ã£ºwebÏîÄ¿×ÔÈ»ÊÇÓ¦ÓóÌÐòµÄ±íʾ²ã£¬¾ÍÊÇ·ÃÎʵÄÕ¾µã£¬ËüÌṩËùÓÐÓëÓû§½øÐн»»¥µÄ ......
1. Êý¾Ý¿â·ÃÎÊÐÔÄÜÓÅ»¯¡¡
¡¡
Êý¾Ý¿âµÄÁ¬½ÓºÍ¹Ø±Õ
·ÃÎÊÊý¾Ý¿â×ÊÔ´ÐèÒª´´½¨Á¬½Ó¡¢´ò¿ªÁ¬½ÓºÍ¹Ø±ÕÁ¬½Ó¼¸¸ö²Ù×÷¡£ÕâЩ¹ý³ÌÐèÒª¶à´ÎÓëÊý¾Ý¿â½»»»ÐÅÏ¢ÒÔͨ¹ýÉí·ÝÑéÖ¤£¬±È½ÏºÄ·Ñ·þÎñÆ÷×ÊÔ´¡£ASP.NETÖÐÌṩÁËÁ¬½Ó³Ø(Connection Pool)¸ÄÉÆ´ò¿ªºÍ¹Ø±ÕÊý¾Ý¿â¶ÔÐÔÄܵÄÓ°Ï졣ϵͳ½«Óû§µÄÊý¾Ý¿âÁ¬½Ó·ÅÔÚÁ¬½Ó³ØÖУ¬ÐèҪʱȡ³ö£¬¹Ø±ÕÊ±Ê ......