【发布时间】:2013-07-23 00:34:35
【问题描述】:
所以我试图从 litview 子项中获取 ByteCount,但它总是显示负面错误: [Argument OutOfRangeException 未处理:'count' 不能为负,参数名称:count] 这是我得到错误的代码行:
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)))));
}
不起作用,甚至使if条件为'> -1',结果相同。
【问题讨论】:
标签: c# winforms listview binarywriter