一聚教程网:一个值得你收藏的教程网站

热门教程

用C#轻松在DOTNET中实现缩略图

时间:2022-07-02 11:06:08 编辑:袖梨 来源:一聚教程网

 以前,在页面上实现缩略图必须借助第三方组件。现在,有了.NET,就可以很轻松地实现缩略图。下面就是实现缩略图的例子。
ToThumbnailImage.aspx
<%@ Page language="c#" Codebehind="ToThumbnailImage.aspx.cs" Src="ToThumbnailImage.aspx.cs" AutoEventWireup="false"
Inherits="Exam_C.ToThumbnailImage" %>

 
      Lion互动网络 =>生成缩略图
 
 
     

    

 

 ToThumbnailImage.aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Drawing.Imaging;
namespace Exam_C
{
 ///
 /// ToThumbnailImage 的摘要说明。
 ///

 public class ToThumbnailImage : System.Web.UI.Page
 {
  /* 
  Create By lion 
  2003-05-20 19:00 
  Copyright (C) 2004 www.LionSky.Net. All rights reserved.
  Web: http://www.Lionsky.net ;
  Email: lion-a@sohu.com
  */ 
  static Hashtable htmimes=new Hashtable();
  internal readonly string AllowExt = ".jpe|.jpeg|.jpg|.png|.tif|.tiff|.bmp";

热门栏目