I am trying to download a list of files, but isn't really sure of how to proceed. As the topic says, I am using DropNet, and this is the procedure I am trying to download the files with:
Get a list of all files in my applications dedicated folder and store them in a List as strings.
Then trying the following:
foreach (string file in files)
{
_client.GetFileAsync("/" +file,
(response) =>
{
using(FileStream fs = new FileStream(path +file +".gttmp", FileMode.Create))
{
for(int i = 0; i < response.RawBytes.Length; i++)
{
fs.WriteByte(response.RawBytes[i]);
}
fs.Seek(0, SeekOrigin.Begin);
for(int i = 0; i < response.RawBytes.Length; i++)
{
if(response.RawBytes[i] != fs.ReadByte())
{
MessageBox.Show("Error writing data for " +file);
return;
}
}
}
},
(error) =>
{
MessageBox.Show("Could not download file " +file, "Error!");
});
}
Unfortunately it doesn't seem to work at all. Anyone using DropNet and could suggest me something that would work?