.Net try parse a to a long data type

Quick post on how to parse a string to a long.

long fileSizeResult;

if (long.TryParse(fileSize, out fileSizeResult) == false)
{
    fileSizeResult = 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *