A function in c sharp to get working directory the programm
private string? GetWorkingdir()
{
string? tmpDir = "";
try
{
string tmpDir1 = AppContext.BaseDirectory;
if (Directory.Exists(tmpDir1))
{
Console.WriteLine("dir exists read file ??");
tmpDir = tmpDir1;
}
}
catch (Exception ex)
{
System.Console.WriteLine(ex);
tmpDir = null;
}
return tmpDir;
}
Cheers