gpt4 book ai didi

c# - 如何为不同的文化使用资源 Dll

转载 作者:太空宇宙 更新时间:2023-11-03 16:09:50 25 4
gpt4 key购买 nike

我已经为不同的文化创建了 DLL(DynamicResourceDLL),如下所示

DynamicResourceDLL.Cart.Cart //English
DynamicResourceDLL.Cart.Cart_de_DE
DynamicResourceDLL.Cart.Cart_es_ES
DynamicResourceDLL.Cart.Cart_fr_FR

我在我的项目中添加了这个DynamicResourceDLL dll并尝试获取key的值

string strCityEnglish = DynamicResourceDLL.Cart.Cart.City //it's working fine

但是

string strCityDe =  DynamicResourceDLL.Cart.Cart_de_DE.City //it's not working 

我遇到了错误

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "DynamicResourceDLL.Cart.Cart_de_DE.resources" was correctly embedded or linked into assembly "ExportToExcelFromDataTable" at compile time, or that all the satellite assemblies required are loadable and fully signed.

请让我知道如何通过代码将此 Dll 用于不同的文化,或者如果我在上面有任何错误,请提出建议。

最佳答案

这是一个 ASP.NET 应用程序吗?如果是这样,下面的资源将为您提供帮助。

http://msdn.microsoft.com/en-us/library/1ztca10y(v=vs.85).aspx

如果是 Windows 应用程序,请参阅下面的示例。

http://www.codeproject.com/Articles/352105/Satellite-Assembly-Example-in-Csharp-Step-by-Step

希望这对您有所帮助。谢谢。

关于c# - 如何为不同的文化使用资源 Dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17945508/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com