Answer the question
In order to leave comments, you need to log in
Where to look for data loss?
Hello Dear!
Please find mysticism in ("3 pines") code.
public Updates Updates(long version, string fileName, string key_service)
{
Updates update = new Updates();
try
{
if (key_service == "КлючьКФайлу")
{
byte[] buffer; //Временная переменная
List<Files> listDll = Hepler.List(path_dll, new List<string> { "*.dll", "*.exe" });
List<Files> selectFile = listDll.FindAll(delegate (Files teach) { return teach.name.StartsWith(fileName); });
if (selectFile.Count > 0)
{
long ver = long.Parse(selectFile[0].version.Replace(".", ""));
if (ver > version)
{
//На сервере есть обновления
FileStream fs = new FileStream(selectFile[0].fullName, FileMode.Open);
buffer = new byte[fs.Length];
int len = (int)fs.Length;
fs.Read(buffer, 0, len);
fs.Close();
update.file = buffer;
update.node = "Доступна новая версия";
}
}
else
{
update.node = "Неизвестный файл";
}
}
}
catch (Exception ex)
{
log.Error(ex.ToString());
}
return update;
}
Answer the question
In order to leave comments, you need to log in
"An empty head - does not give rest to the legs"
The whole error was in the version of the file on the
server if (ver > version)
. we send version 2017091318 and the server has version 201709181
Conclusion: I fixed the file version on the server to 2017091801 and the problem was solved.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question