[VS2008 Express] Problème avec File.SetLastWriteTime
Bonjour,
je ne comprend pas voici mon code source :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
| private bool CommandMFMT(String LocalFileName, String fDateTime, ref int error)
{
String sYear;
String sMonth;
String sDay;
String sHour;
String sMinute;
String sSeconde;
bool retour = false;
error = SYNTAX_ERROR;
if (File.Exists(LocalFileName) == true)
{
if (fDateTime.Length == 14)
{
sYear = fDateTime.Substring(0, 4);
sMonth = fDateTime.Substring(4, 2);
sDay = fDateTime.Substring(6, 2);
sHour = fDateTime.Substring(8, 2);
sMinute = fDateTime.Substring(10, 2);
sSeconde = fDateTime.Substring(12, 2);
try
{
File.SetLastWriteTime(LocalFileName, DateTime.Parse(sYear + "-" + sMonth + "-" + sDay + " " + sHour + ":" + sMinute + ":" + sSeconde));
retour = true;
}
catch
{
error = NOT_VALID_DATE;
}
}
}
else
{
error = FILE_NOT_FOUND;
}
return retour;
} |
j'ai en entré "c:\temp\ftpserv.exe" et "20080102030405".
J'ai une date en 2008/02/01 03:04:05 mais le fichier lui est en 01/02/2008 04:04:05.
Là je ne comprend pas, est-un bug de Visual Studio 2008 Express ?
Merci