Let's say I have binary code in C # ae / a / b / c / xyz.exe code, and it expects /a/b/c/hello.txt in the same directory. How can I get /a/b/c/hello.txt in the full path?
In python, I can get the running program path using os.path.abspath(sys.argv[0]) , and I can get the directory information with dirname (), and I can use join () for the new full path.
import sys from os.path import * newName = join(dirname(abspath(sys.arg[0]), "hello.txt")
How can C # do the same?
source share