1. Use the System.getproperty () function to get the current path:System.out.println (System.getproperty ("User.dir"));//user.dir Specifies the current path2. Use the function provided by file to get the current path:File directory = new file ("");//
Under Ubuntu, by default, the absolute path is shown for the terminal, for example:650) this.width=650; "title=" Terminal Show full path "style=" Border-top:0px;border-right:0px;background-image:none;
I haven't written technical articles here for a long time. I can't help you. But at noon today, I think of good news. Today, I found a good thing, and now I am very happy. Haha, I can also be a hacker! Haha.
/-----------------------------------------
Original source: http://www.csharpwin.com/csharpspace/5025r2141.shtmlC # Gets the current path in the following ways:
1. System.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filename
-Gets the full path of the module.
2.
Direct double-click to execute D:\test1.exeSystem.Diagnostics.Process.GetCurrentProcess (). Mainmodule.filename D:\Test1.exeSystem.Environment.CurrentDirectory D:\System.IO.Directory.GetCurrentDirectory ()
Sometimes we need to obtain the path for executing the current vbs, so we can refer to the following code, which is generally used to delete itself and other operations. CMD current path
test = createobject("Scripting.FileSystemObject").GetFolder(".
1. On WM, the. NET simplified framework is used. Therefore, many common methods on PC cannot be used on WM.
For example, you cannot use the appdomain class, Directory class, or system. Environment class to obtain the current path.
However, you can
Today, I figured out that if C ++ is used to obtain the current path, and the current path is obtained as the basis, the test code is as follows. If there is a comment error, please refer to the correct example ~~
# Include # include # include
Transferred from: http://www.gaobo.info/read.php/660.htm[C-sharp]View Plaincopy
Gets the full path of the current process, including the file name (process name).
String str = this . GetType (). Assembly.location;
Result:x:/xxx/xxx/xxx.exe
C # The method for obtaining the current path is as follows:
1. System. Diagnostics. Process. GetCurrentProcess (). MainModule. FileName
-Obtain the complete path of the module.
2. System. Environment. CurrentDirectory
-Get and set the fully
Function:
DWORD getcurrentdirectory (DWORD nbufferlength, // size, in characters, of directory buffer lptstr lpbuffer // pointer to buffer for current directory );
Obtain the current path of the executable file. This problem may occur during use:
What is the current path of ZF? Please help. Thank you! I have encountered a problem after studying zendframework for a while. I hope you guys can help solve this problem. thank you for working on the background, adminControll. php access is http: //
Java gets the system path font, obtains all the file names under a directory, gets the current path
Copy Code code as follows:
Package com.liuxing.test;
Import java.awt.GraphicsEnvironment;Import Java.io.File;public class Test {
In DOS batches, it is sometimes necessary to know the current path. In DOS, there are two environment variables that can relate to the current path, one is%cd%, and the other is%~dp0.
The use of these two variables and the content of the
First, get the absolute path of the current running directory
1. Use GetCurrentDirectory functionAssuming the program path is D:\Test\tst.exe, execute the getcurrentdirectory function
Char Pbuf[max_path];
GetCurrentDirectory (MAX_PATH,PBUF);
Transferred from: http://www.cnblogs.com/wind-wang/p/5822192.htmlPython Gets the current pathImport Os,sysUse sys.path[0], sys.argv[0], OS.GETCWD (), Os.path.abspath (__file__), Os.path.realpath (__file__)Sys.path is a list of search paths that
WinForm gets a collection of methods for the current path of the application, as follows, which is worth collectingThis article source: http://www.cnblogs.com/greatverve/archive/2011/12/15/winform-path.htmlGets the full path of the current process,
WinForm Gets a collection of methods for the current path of the application, as follows, which is worth collecting//gets the full path of the current process, including the file name (process name). stringstr = This. GetType ().
What is the current path of ZF? Please help. Thank you! I have encountered a problem after studying zendframework for a while. I hope you guys can help solve this problem. thank you for working on the background, adminControll. php access is the
C # Get the current path methodGets the path or UNC location of the loaded file that contains the manifest.public static string Sapplicationpath = Assembly.getexecutingassembly (). Location;Result:x:\xxx\xxx\xxx.dll (the directory where the. dll
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.