简体   繁体   中英

Rename Resource file in Project C#

I have a multiple languages project ASP.Net. I use Resouce file for my project.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM