SoFunction
Updated on 2025-03-07

C# to obtain the implementation method of the superior directory

using system;
using ;
using ;
using ;
using ;
namespace pathtest
{
class program
{
static void main(string[] args)
{
//Use appdomain to get the execution directory of the current application assembly
string dir = ;
string info = ("appdomain method gets the current assembly directory: {0}", dir);
(info);
//Use path to get the upper directory of the execution of the current application assembly
dir = ("..");
info = ("path method gets the current assembly upper directory: {0}", dir); ()
(info);
//Use path to get the upper directory of the execution directory of the current application assembly
dir = (@"....");
info = ("path method gets the upper directory of the current assembly directory: {0}", dir);
(info);
//Use path to get the upper directory of the execution directory of the current application assembly
dir = (@"......");
info = ("path method gets the upper directory of the current assembly directory: {0}", dir);
(info);
//Add the specified directory in the current assembly directory
dir = (@"io");
info = ("Add the specified directory in the current assembly directory: {0}", dir);
(info);
();
}
}
}