2013年9月22日星期日

java application into exe files . How to get exe file path where

 This post last edited by the cflianna on 2012-11-21 19:11:22
I have an application that will turn into exe files. I want to run the file, to read the folder where the exe file under a a.xml, can also be modified to increase and so on. A.xml a package and can not be transferred into exe because a.xml are modifiable . Now the problem is how do I get in the application to the folder path . The Lord is also the path to the folder where the exe . Seeking advice.
------ Solution ---------------------------------------- ----
string current_dir = Environment.CurrentDirectory; \ \ get the root directory
string config_file = current_dir + "\ \ owaoma.ini"; \ \ root directory of the file
java forums, long time did not come
in. net is written as
java main method is also with this function when running system.out.println (current_dir) output in the root directory of the black form that is exe position
---- - For reference only ---------------------------------------
xml file put exe program and sibling to a folder. With new File ("test", "test.xml"); This run inside Eclipse and build jar runs without problems, but when students become exe missing tips I can not find the path , and then I get the absolute path , but this is the absolute path for the system temporary path . Eg : C: \ Documents% 20and% 20Settings \ liying \ Local% 20Settings \ Temp \ test \ test.xml. Get absolute path method is this. URL urls = getClass (). GetResource ("GlobleValue.class"); path = urls.getFile (). Replace ('/', File.separatorChar); < br> ------ For reference only ---------------------------------------
wood was it ? Seeking support
------ For reference only ------------------------------------ ---
resolved. Oh . Thank you upstairs
------ For reference only ---------------------------------- -----
ask is how to solve this problem ?
------ For reference only -------------------------------------- -
prawn , can provide about the java is how to solve it ? Urgent Oh !

没有评论:

发表评论