Hi,
I’m trying to load listbox items names from database.txt, which is located in the HOME/Database directory on real robot controller.
I get an exception “SYS_CTRL_E_FILE_NOT_FOUND” (File not found or could not be opened for reading). What am I doing wrong?
//Creating controller object
public static Controller aController = new Controller();
//Loading listbox items from txt
private void TpsViewDatabase_Load(object sender, EventArgs e)
{
//Accessing files and directories
FileSystem aFileSystem = aController.FileSystem;
//Creating remote directory
aController.FileSystem.RemoteDirectory = “HOME/Database”;
string remoteDir = aController.FileSystem.RemoteDirectory;
aController.FileSystem.LocalDirectory = “c:/temp”;
//Saving txt to controller remote directory
aController.FileSystem.PutFile(“database.txt”, remoteDir);
using (StreamReader sw = new StreamReader(remoteDir + “/database.txt”))
{
listViewItem1.Text = sw.ReadLine();
listViewItem2.Text = sw.ReadLine();
listViewItem3.Text = sw.ReadLine();
…
}
}
}
//Exiting
private void button1_Click(object sender, EventArgs e)
{
//this.Hide();
this.CloseMe();
if (aController != null)
{
aController.Dispose();
aController = null;
}
}
Regards