hej,
tak jak napisalem w temacie, chcialbym dodac petle lub try catcha ? do programu, tak by uzytkownik nie mogl dodac xml-a o rozmiarze 0 KB
pozdrawiam
hej,
tak jak napisalem w temacie, chcialbym dodac petle lub try catcha ? do programu, tak by uzytkownik nie mogl dodac xml-a o rozmiarze 0 KB
pozdrawiam
a co stoi na przeszkodzie, aby po wskazaniu przez usera takowego pliku, sprawdzić jego rozmiar?
sadzicie cz tutaj da sie dodac ten warunek?
string line, title;
string fname = "C:\xxxxx_xxxx\temp\temp" + objRecord.Uri.ToString() + ".xml";
objRecord.GetDocument(fname, false, null, null);
line = File.ReadAllText(fname);
title = objRecord.Title;
znalazlem co takiego, tylko nie wiem jak i czy da sie to wplesc w to co mam wyzej:
if (new FileInfo(fileName).Length ==0){
// file is empty
} else {
// there is something in it
}
Pewnie coś w tym stylu:
var fname = "C:\\xxxxx_xxxx\\temp\\temp" + objRecord.Uri.ToString() + ".xml";
if ((new FileInfo(fname)).Length != 0)
{
objRecord.GetDocument(fname, false, null, null);
line = File.ReadAllText(fname);
title = objRecord.Title;
}