public string GetWorkingDirectory()
{
//PWD - print working directory
Connect();
SendCommand("PWD");
ReadResponse();
if (response != 257)
throw new Exception(responseStr);
string pwd;
try
{
pwd = responseStr.Substring(responseStr.IndexOf("\"", 0) + 1);//5);
pwd = pwd.Substring(0, pwd.LastIndexOf("\""));
pwd = pwd.Replace("\"\"", "\""); // directories with quotes in the name come out as "" from the server
}
catch (Exception ex)
{
throw new Exception("Uhandled PWD response: " + ex.Message);
}
return pwd;
}
/// <summary>