I am trying to separate the values โโof DriveInfo.AvailableFreeSpace and DriveInfo.TotalSize in order to try to get a percentage of it for use in the progress bar.
I need the final value to be int, since progressbar.value requires that int and the above methods return a long one.
I have this meaning:
164660715520 --- AvailableFreeSpace
256058060800 --- TotalSize
When I try to set the value of progressbar.value using this method, I also get the error message:
progressBar1.Value = (integer) (dInfo.AvailableFreeSpace / dInfo.TotalSize) * 100;
When I use this code to try to get the value, it just returns 0.
label10.Text = (((int)dInfo.AvailableFreeSpace/dInfo.TotalSize)*100).ToString();
I even tried this and it does not work:
label10.Text = ((dInfo.AvailableFreeSpace/dInfo.TotalSize)*100).ToString();
, , , , , 0.
- long int?