.net中多语言资源的访问(使用assemble和卫星assemble的方法)
来源:互联网 发布:java判断stringbuffer 编辑:程序博客网 时间:2024/06/03 22:53
!WebApplication1.cs!
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Globalization;
using System.Resources;
using System.Reflection;
using System.Threading;
namespace WebApplication1
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
private void Page_Load(object sender, System.EventArgs e)
{
CultureInfo ci = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentUICulture = ci;
String AssemblyPath = "string";
Assembly asm = Assembly.Load(AssemblyPath);
ResourceManager rm = new ResourceManager("string",asm);
TextBox1.Text = rm.GetString("txtGreeting");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
compile.bat
echo on
RM string.resources
RM string.ja-JP.resources
RM string.dll
RM ja-JP/string.resources.dll
resgen string.txt
resgen string.ja-JP.txt
al /out:string.dll /embed:string.resources
al /t:lib /culture:ja-JP /embed:string.ja-JP.resources /out:ja-JP/string.resources.dll
PAUSE
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Globalization;
using System.Resources;
using System.Reflection;
using System.Threading;
namespace WebApplication1
{
public class WebForm1 : System.Web.UI.Page
{
protected System.Web.UI.WebControls.TextBox TextBox1;
private void Page_Load(object sender, System.EventArgs e)
{
CultureInfo ci = Thread.CurrentThread.CurrentCulture;
Thread.CurrentThread.CurrentUICulture = ci;
String AssemblyPath = "string";
Assembly asm = Assembly.Load(AssemblyPath);
ResourceManager rm = new ResourceManager("string",asm);
TextBox1.Text = rm.GetString("txtGreeting");
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
compile.bat
echo on
RM string.resources
RM string.ja-JP.resources
RM string.dll
RM ja-JP/string.resources.dll
resgen string.txt
resgen string.ja-JP.txt
al /out:string.dll /embed:string.resources
al /t:lib /culture:ja-JP /embed:string.ja-JP.resources /out:ja-JP/string.resources.dll
PAUSE
- .net中多语言资源的访问(使用assemble和卫星assemble的方法)
- assemble
- Assemble
- Assemble
- assemble、compile、make、build和rebuild的关系
- mdadm Assemble模式下的force参数
- Assemble(王爽)——nasm 和 masm的一些简单区分
- Assemble hoj 不错的二分题 稍有繁琐
- 12124 - Assemble
- LA3971 - Assemble
- UVa12124 - Assemble
- uva12124-Assemble
- LA3971 Assemble
- LA3971 Assemble
- uva12124 Assemble
- WOJ1303-Assemble
- 【UVA12124】Assemble
- get string from assemble in .NET
- PHP5薄荷教程[20]数组操作函数(1)
- Percy Buttons 珀西.巴顿斯
- 编程经验谈:如何正确使用内存
- PHP5薄荷教程[19]字符串操作函数(3)
- PHP5薄荷教程[21]数组操作函数(2)
- .net中多语言资源的访问(使用assemble和卫星assemble的方法)
- PHP5薄荷教程[22]文件操作函数
- PHP5薄荷教程[23]零星函数
- PHP5薄荷教程[24]MySQL操作函数
- 开发media play,realplayer,暴风影音 等主流播放器视频特效插件
- PKU ACM 1000~1010解题总结
- HTML扫盲教程
- 时间函数
- find 命令