c# get current directory xamarin

C#
string path = "";
System.Collections.IDictionary vars = System.Environment.GetEnvironmentVariables();
foreach (System.Collections.DictionaryEntry entry in vars)
{
     if (entry.Key.ToString().Contains("HOME"))
         path = entry.Value.ToString();
}
Source

Also in C#: