public static void SetCurrentDirectory(string path) { if (path == null) { throw new ArgumentNullException("path"); } if (path.Trim().Length == 0) { throw new ArgumentException("path string must not be an empty string or whitespace string"); } MonoIOError error; if (!Exists(path)) { throw new DirectoryNotFoundException("Directory \"" + path + "\" not found."); } MonoIO.SetCurrentDirectory(path, out error); if (error != MonoIOError.ERROR_SUCCESS) { throw MonoIO.GetException(path, error); } }