Dear Friends,
I say first thank you to all in advance.
Actually we have one window service in which upload xml data into our oracle database.
That run throughout of the day. But I want to allow only those xml files wich are bigger than certain size.
Service is in C#.net
Please help me...... Sorry I unable to upload code..please suggest me usefull method.
Again Thank you!!!!
Regards,
Ranjit
Loading
Vikrant JadhavPosted Dec 16, 2011, 2:19 AM
public string GetFileSize(long Bytes)
{
if (Bytes >= 1073741824)
{
Decimal size = Decimal.Divide(Bytes, 1073741824);
return String.Format("{0:##.##} GB", size);
}
else if (Bytes >= 1048576)
{
Decimal size = Decimal.Divide(Bytes, 1048576);
return String.Format("{0:##.##} MB", size);
}
else if (Bytes >= 1024)
{
Decimal size = Decimal.Divide(Bytes, 1024);
return String.Format("{0:##.##} KB", size);
}
else if (Bytes > 0 & Bytes < 1024)
{
Decimal size = Bytes;
return String.Format("{0:##.##} Bytes", size);
}
else
{
return "0 Bytes";
}
}
//Call the Above Method as Follows for sample