Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone,

Finally, I finished my graduation project. I am putting some extra facilities. However, ı faced with a problem. There was a code line in .net while reading some folders or files. when we wrote Application.StartupPath... the project directs the user "proje\bin\debug folder. In this manner, I want to use the same facility. I have a resources.rar folder. When the user clicked on the download the source link this should be downloaded. However, I am using my own path C:Users/Emre/etc...

Is there any way to solve this?

Thank you.
Posted
Comments
Sergey Alexandrovich Kryukov 17-Jan-13 19:05pm    
Not quite clear. Do you need similar functionality for Java, or it is still somehow related to .NET?
—SA
FoxRoot 18-Jan-13 2:09am    
I am sorry, I am using the file path as C:Users/Emre/....
But, when we move the project to another pc, it wont work. There was a code in .net we use Application.StartupPath+"\resources.rar" and this works any pc. I am asking is there a code doing sama things for java?

Yes. You need to use relative paths, not absolute.
There should be a package ResourceBundle for doing so. Please check that.

If you are linking in from another destination (some .net app), you should use a property for configuring a decent path.
 
Share this answer
 
Comments
FoxRoot 18-Jan-13 2:09am    
I am sorry TorstenH. Still couldn't find anything.
TorstenH. 18-Jan-13 5:58am    
yeah - google is wired. I like to use "feel lucky" in those cases. Works quite well:

ResourceBundle in Java 6SE
FoxRoot 18-Jan-13 7:43am    
Thank you TorstenH. I solved with this link.
For the record: I believe I answered here: Raising the portability of program[^].

—SA
 
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