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 是重点