Check out example codes for "c# get script directory". It will help you in understanding the concepts better.

Code Example 1

var DDIR = System.IO.Directory.GetCurrentDirectory();
var WorkingDirectory = "";
int index = DDIR.IndexOf(@"\");
if (index > 0)
	WorkingDirectory = DDIR.Substring(0, index) + @"\";

Code Example 2

System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

Code Example 3

string appPath = System.IO.Path.GetDirectoryName(Application.ExecutablePath);

Learn ReactJs, React Native from akashmittal.com