[英]Rename Resource file in Project C#
I have a multiple languages project ASP.Net. 我有一个多语言项目ASP.Net。 I use Resouce file for my project.
我将Resouce文件用于我的项目。
Now I use: 现在我使用:
Resource.lbltestenter
But I want to change name from Resouce to Language: 但我想将名称从“资源”更改为“语言”:
Language.lbltestenter
But i don't know how do that? 但是我不知道怎么办? Please help me.
请帮我。 Thanks so much.
非常感谢。
In the comments to your question you mentioned: 在对您的问题的评论中,您提到:
Because i have 2 projects (A and B), and i use preference dll from project A for project B, but inside dll of project A have Resource file, when i call Resource in project B, it's always preference Resource of project A.
因为我有2个项目(A和B),并且我将项目A的首选项dll用于项目B,但是项目A的dll内部具有资源文件,因此当我在项目B中调用Resource时,它始终是项目A的首选项资源。
It is common to have the same class in multiple namespaces. 在多个名称空间中具有相同的类是很常见的。 All you have to do is to qualify your class name with the namespace:
您要做的就是用名称空间来限定类名:
Namespace.Resource = new Namespace.Resource();
If you do not want to type long namespace names, then use an alias for it like this: 如果您不想键入长名称空间名称,则可以使用别名,如下所示:
// obviously do not call it A but give it a more meaningful name
using A = Company.MyCompany.Project;
Then you can just qualify it like this: 然后,您可以像这样限定它:
A.Resource = new A.Resource();
You can read more here on using
directive. 你可以阅读更多在这里上
using
指令。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.