80489874 on the same csdnC Language Get executable file (XXX.exe) filename and directory pathVc2010 compiled by1#include 2#include string.h>3#include 4#include 5 6 intMainintargcChar*argv[]) {7 8printf"%s\n", argv[0]);//argv[0] Output path with the
Get path and Web application get path method in Java file1. Understanding of Basic Concepts' Absolute path ': The real path on the hard disk where you apply the file or directory, such as: URL, physical pathFor example:C:/xyz/test.txt represents the
Original address: Http://my.oschina.net/xianggao/blog/85172?fromerr=WnWLB6aV1. Understanding of Basic Concepts' Absolute path ': The real path on the hard disk where you apply the file or directory, such as: URL, physical pathFor example:C:/xyz/test.
1. How to obtain the current file path
Frequently used:
String type: system. getproperty ("user. dir ");
Overall:
Package com. zcjl. Test. base;Import java. Io. file;Public class test {Public static void main (string [] ARGs) throws exception
1. How to obtain the current file path
Frequently used:
String type: system. getproperty ("user. dir ");
Overall:
Package com. zcjl. Test. base;Import java. Io. file;Public class test {Public static void main (string [] ARGs) throws exception
Net to get the assembly path, net to get the path
The Assembly loaded from the memory, with no path
IIS path
Protectedvoid Page_Load (object sender, EventArgs e){Response. Write ("Assembly path" + System. Reflection. Assembly.
The implementation code for the Struts2 file download function is as follows:
Action file
public class Downloadaction extends Actionsupport {/** * */private static final long Serialversionuid = 58797622317
42395104L; private string filename;//
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
Https://www.cnblogs.com/tianma3798/p/6553863.html1.Gets 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
The recent write code has a need to traverse every file in the directory and get the absolute path to the file,We know that there are system commands in Linux C + + so I made a log in the code, and then I read each line of the log file, and then I
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.