读书人

aspx的WEB代理图片显示有关问题

发布时间: 2013-03-19 17:22:05 作者: rapoo

aspx的WEB代理图片显示问题

求指导~~~ 代理 web 图片显示 proxy
[解决办法]
switch (type)
{
case "icon":
if (!typeValue.EndsWith(".png") && !typeValue.EndsWith(".gif"))
{


typeValue = IconHelper.GetName((Icon)Enum.Parse(typeof(Icon), typeValue));
}
//resName += "res.icon." + typeValue;
string serverPath = String.Format("{0}/{1}", GlobalConfig.GetIconBasePath(), typeValue);
context.Response.WriteFile(context.Server.MapPath(serverPath));

context.Response.ContentType = "image/" + GetImageFormat(typeValue);
break;
case "js":
case "lang":
context.Response.Write(ResourceHelper.GetResourceContent(resName));
context.Response.ContentType = "text/javascript";
break;
case "css":
context.Response.Write(ResourceHelper.GetResourceContent(resName));
context.Response.ContentType = "text/css";
break;
case "theme":
case "img":
binary = ResourceHelper.GetResourceContentAsBinary(resName);
context.Response.OutputStream.Write(binary, 0, binary.Length);
//context.Response.Write(ResourceHelper.GetResourceContent(resName));
context.Response.ContentType = "image/" + GetImageFormat(resName);
break;
}


context.Response.ContentType 是重点

读书人网 >asp.net

热点推荐