0
所以我想從一個litview子項中獲取ByteCount,但它總是顯示負值錯誤: [參數OutOfRangeException未處理:'count'不能爲負,參數名稱:算上] 這是代碼行,我得到的錯誤:GetByteCount顯示爲負值,但它不是
bw.Write(enc.GetBytes(listView1.Items[i].SubItems[3].Text + (new string('\0',dbytecnt - enc.GetByteCount(listView1.Items[i].SubItems[3].Text)))));
我想這:
if (enc.GetByteCount(listView1.Items[i].SubItems[3].Text) > 0)
{
bw.Write(enc.GetBytes(listView1.Items[i].SubItems[3].Text + (new string('\0',dbytecnt - enc.GetByteCount(listView1.Items[i].SubItems[3].Text)))));
}
無法正常工作,甚至提出如果條件是「> -1」,相同的結果。
謝謝你,taht是我所需要的:d – Omarrrio