المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : .Net gone crazy



C# Programming
11-13-2009, 01:50 PM
I wrote a code that is using BackgroundWorker and updating ProgressBar on ProgressChanged. But when I ran it the ProgressBar shown some progress then app got hang for long time. So I thought to check the error and finally reached on a most annoying freaky error. That is the calculation is wrong. And after all I wrote a line for debugging

System.Diagnostics.Debug.WriteLine(bytesReaded + " * 100 / " + totalBytesToRead + " = " + ((bytesReaded * 100) / totalBytesToRead));

and the output will blow the mind of

a snippet
36257792 * 100 / 54444964 = -12
36274176 * 100 / 54444964 = -12
36290560 * 100 / 54444964 = -12
36306944 * 100 / 54444964 = -12
36323328 * 100 / 54444964 = -12
36339712 * 100 / 54444964 = -12
36356096 * 100 / 54444964 = -12
36372480 * 100 / 54444964 = -12
36388864 * 100 / 54444964 = -12
36405248 * 100 / 54444964 = -12
36421632 * 100 / 54444964 = -11
36438016 * 100 / 54444964 = -11
36454400 * 100 / 54444964 = -11
36470784 * 100 / 54444964 = -11
36487168 * 100 / 54444964 = -11

I have exactly same code line with ListView and it works good. But this one aint...any idea ?



TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87?‘6?N8?BcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8?mt^7Z6]iTF+(EWfJ9zaK-i?TV.C\y


-----------------------------------------------
128 bit encrypted signature, crack if you can