asp.Net 一些常用的方法和类(10)
}
int pagesum;
public int Pagesum
{
get { return pagesum; }
set { pagesum = value; }
}
public PageBean(IList<T> datasource, int pagesum)
{
this.datasource = datasource;
this.pagesum = pagesum;
}
public PageBean()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
}
生成图片水印:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Drawing;
using System.Drawing.Imaging;
/// <summary>
/// PictureHandler 的摘要说明
/// </summary>
public class PicHandler : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
context.Response.ContentType = "text/plain";
string imgUrl = context.Request.PhysicalPath;//得到当前处理图片的物理路径
if (File.Exists(imgUrl))
{
Image img = Image.FromFile(imgUrl);//通过图片路径得到图片对象
Image watering = Image.FromFile(context.Server.MapPath("~/themes/images/water.jpg"));//得到数字水印图片
相关新闻>>
- 发表评论
-
- 最新评论 更多>>