J
Joe Cool
Hello, I am using VS2005. I am trying to convert a VB.NET app to
C#.NET. The VB app uses a progress meter to indiate how far a file has
been read. I use the following assignment statement in VB:
Progress.Value = (lFileReadCount / fi.Length) * 100
lFileReadCount is a Long that contains the current number of bytes
read. fi is a FileInfo object of the file being read. Progress is
shown as a percentage.
In C# the statement is:
Progress.Value = (lFileReadCount / fi.Length) * 100;
Obviously the only difference is the semi-colon at the end. Problem
is, the value of the progress meter never changes from zero.
I put in debug statements and lFileReadCount and fi.Length are what
you would expect. I also put in a debug statement to display the
result of the arithmentic operation, and the result is ALWAYS ZERO!!!
What gives?!?!?
C#.NET. The VB app uses a progress meter to indiate how far a file has
been read. I use the following assignment statement in VB:
Progress.Value = (lFileReadCount / fi.Length) * 100
lFileReadCount is a Long that contains the current number of bytes
read. fi is a FileInfo object of the file being read. Progress is
shown as a percentage.
In C# the statement is:
Progress.Value = (lFileReadCount / fi.Length) * 100;
Obviously the only difference is the semi-colon at the end. Problem
is, the value of the progress meter never changes from zero.
I put in debug statements and lFileReadCount and fi.Length are what
you would expect. I also put in a debug statement to display the
result of the arithmentic operation, and the result is ALWAYS ZERO!!!
What gives?!?!?