有用过 .net 的本地化 的大哥们来看看.
ASP.net做多语言网站.关于本地资源的图片处理. 我在网上看到这个源码.
页面中的调用方法:
<ASP:Image ID= "Image1 " runat= "server " ImageUrl= "~/ MyLocalImage.ashx " />
MyLocalImage.ashx 的处理程序的写法:
public class MyLocalImage : IHttpHandler
{
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "image/png ";
string LanaguageReference = ((ProfileCommon)context.Profile).LanguagePreference;
if (!string.IsNullOrEmpty(LanaguageReference))
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(LanaguageReference);
}
Bitmap bm = Resources.Litware.LitwareSlogan;
MemoryStream image = new MemoryStream();
bm.Save(image,ImageFormat.Png);
context.Response.BinaryWrite(image.GetBuffer());
}
}
--------------------------------------
文字本地化好处理.本地化图像哪里调用路径了??谢谢.我看不出来.有人做过嘛?
------解决方案--------------------GetLocalResourceObject
------解决方案--------------------Thread.CurrentThread.CurrentUICulture = new CultureInfo(LanaguageReference);
------解决方案--------------------Bitmap bm = GetLocalResourceObject( "image1 ") as Bitmap;
没测,自己试试吧
------解决方案--------------------顶你的PP!
------解决方案--------------------我顶楼上的PP!
------解决方案--------------------乱顶一下