64 lines
1.7 KiB
Plaintext
64 lines
1.7 KiB
Plaintext
|
|
<%@ WebHandler Language="C#" Class="imageManager" %>
|
|||
|
|
/**
|
|||
|
|
* Created by visual studio2010
|
|||
|
|
* User: xuheng
|
|||
|
|
* Date: 12-3-7
|
|||
|
|
* Time: <20><><EFBFBD><EFBFBD>16:29
|
|||
|
|
* To change this template use File | Settings | File Templates.
|
|||
|
|
*/
|
|||
|
|
using System;
|
|||
|
|
using System.Web;
|
|||
|
|
using System.IO;
|
|||
|
|
using System.Text.RegularExpressions;
|
|||
|
|
|
|||
|
|
public class imageManager : IHttpHandler
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
public void ProcessRequest(HttpContext context)
|
|||
|
|
{
|
|||
|
|
context.Response.ContentType = "text/plain";
|
|||
|
|
|
|||
|
|
string[] paths = { "upload", "upload1" }; //<2F><>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ¼<C4BF>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>ܻ<EFBFBD><DCBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD><D8B5><EFBFBD>ʱ
|
|||
|
|
string[] filetype = { ".gif", ".png", ".jpg", ".jpeg", ".bmp" }; //<2F>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ
|
|||
|
|
|
|||
|
|
string action = context.Server.HtmlEncode(context.Request["action"]);
|
|||
|
|
|
|||
|
|
if (action == "get")
|
|||
|
|
{
|
|||
|
|
String str = String.Empty;
|
|||
|
|
|
|||
|
|
foreach (string path in paths)
|
|||
|
|
{
|
|||
|
|
DirectoryInfo info = new DirectoryInfo(context.Server.MapPath(path));
|
|||
|
|
|
|||
|
|
//Ŀ¼<C4BF><C2BC>֤
|
|||
|
|
if (info.Exists)
|
|||
|
|
{
|
|||
|
|
DirectoryInfo[] infoArr = info.GetDirectories();
|
|||
|
|
foreach (DirectoryInfo tmpInfo in infoArr)
|
|||
|
|
{
|
|||
|
|
foreach (FileInfo fi in tmpInfo.GetFiles())
|
|||
|
|
{
|
|||
|
|
if (Array.IndexOf(filetype, fi.Extension) != -1)
|
|||
|
|
{
|
|||
|
|
str += "upload/" + fi.Name + "ue_separate_ue";
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
context.Response.Write(str);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
public bool IsReusable
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return false;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|