问题描述:

An error pops up when I write this:

ListView1.Items(0).SubItems.Add(Convert.ToChar(byteData(i)))

The error is:

Overload resolution failed because no accessible 'Convert' accepts this number of arguments.

网友答案:

the Convert.ToChar will work for converting a byte to a char. for example the following cod will work without any problem:

    Dim byteArray(10) As Byte
    byteArray(0) = 65 'code of 'A' char
    Dim ch As Char
    ch = Convert.ToChar(byteArray(0)) 'ch becomes 'A'c

Can you explai more about what type is byteData(i) in your code? maybe it is not a byte as you expected. please check it or give more info from where you have defined it?

相关阅读:
Top