Click here to Skip to main content
15,918,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi all

i have built an windows form application,in which some strings are fetched from resource.resx file. while running in my own pc i can give the path of resource file like c:/myapp/resources.resx but after deploying and installing it on other computer how the code will know the path of the file.
i mean, is there any similiar method like server.mappath (web applications).
please help.
i have tried so far:
C#
string appDir = System.Reflection.Assembly.GetExecutingAssembly().Location;
//string sResxPath = @"C:\Users\PC1\Documents\Visual Studio 2008\Projects\Instantsms\Instantsms\contacts.resx";
string sResxPath = System.IO.Path.Combine(appDir, "contacts.resx");
Posted
Comments
Timberbird 16-Nov-11 7:18am    
Do you have only one resource file or you would like to switch between different files? Why not embed resources?

1 solution

If you built the application, the exe is created.
These resources are embedded in your EXE file.
These resources does not exist as separate files at runtime.
So need not to do....
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900