简体   繁体   English

如何在文件夹app_localresources中添加许多资源?

[英]how to add many resources in folder app_localresources?

In Visual Studio, I have the folder app_localresource s with 2 resources: example.aspx.resx and example.aspx.en.resx. 在Visual Studio中,我有2个资源的app_localresource文件夹:example.aspx.resx和example.aspx.en.resx。 example.aspx.resx file was created automatically and the another is a copy, but in the solution I have: example.aspx, example2.aspx, example3.aspx... How do I add more resources files automatically? example.aspx.resx文件是自动创建的,另一个是副本,但是在解决方案中我有:example.aspx,example2.aspx,example3.aspx ...如何自动添加更多资源文件?

我已经找到了解决方案,仅是在设计模式下,然后单击菜单工具->生成本地资源。

What do you mean by "automatically"? “自动”是什么意思? It seems that you could use this MSDN article. 看来您可以使用 MSDN文章。 Code excerpt taken from this article: 本文摘录的代码摘录:

using (ResXResourceWriter resx = new ResXResourceWriter(@".\CarResources.resx"))
  {
     resx.AddResource("Title", "Classic American Cars");
     resx.AddResource("HeaderString1", "Make");
     resx.AddResource("HeaderString2", "Model");
     resx.AddResource("HeaderString3", "Year");
     resx.AddResource("HeaderString4", "Doors");
     resx.AddResource("HeaderString5", "Cylinders");
     resx.AddResource("Information", SystemIcons.Information);   
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 asp.net App_LocalResources文件夹 - asp.net App_LocalResources folder 如何使用特定区域性从App_LocalResources文件夹中的resx文件读取? - How to read from a resx file in the App_LocalResources folder using a specific culture? 在App_LocalResources中添加文件夹 - Adding Folders in App_LocalResources 如何从Build Process中删除App_LocalResources - How to remove App_LocalResources from Build Process Web应用程序App_LocalResources无法正常工作 - Web Application App_LocalResources Not Working Assembly.GetExecutingAssembly()。GetManifestResourceNames()是否从App_LocalResources返回资源? - Does Assembly.GetExecutingAssembly().GetManifestResourceNames() return resources from App_LocalResources? 如何通过读取App_LocalResources文件(.resx)来本地化asp:TextBox的占位符 - How to localized asp:TextBox's placeholder by reading App_LocalResources file (.resx) 如何将文件夹(带有帮助)添加到资源以及如何使用它 - How to add a folder (with help) to resources and how to work with it 如何在Windows服务应用程序上添加资源文件? - How to add resources file on windows service app? 将图像添加到项目资源文件夹运行时 - Add image to project resources folder runtime
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM