C# Datetime Hatası?
-
while ((line = fs.ReadLine()) != null
)
{
Match
match = regex.Match(line);
DateTime key = Convert.ToDateTime(match.Groups["date"
].Value);
string note = match.Groups["note"
].Value;
data[key] = note;
}
Bu satırda
DateTime key = Convert.ToDateTime(match.Groups["date"].Value);
debug ederken şöyle bir hata alıyorum
An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll
Additional information: Dize geçerli bir DateTime olarak tanınmadı.
Tesekkürler...
-
match.Groups["date"].Value dan gelen değerde sıkıntı var null yasa boş geliyor olabilir
-
DateTime.ParseExact(date, "dd/MM/yyyy HH:mm", System.Globalization.CultureInfo.InvariantCulture)
şeklinde kullan kayıttaki formata göre düzenle
Toplam Hit: 4006 Toplam Mesaj: 3
