发现在XSD 中,节点为Image 类型,转换出的cs 代码中却是 sbyte[] 类型的。
查阅MSDN ,告知sbyte 和 byte 需要显示转换。
由查阅网上不少文章,发现大家碰到这个转换,大多都采用 for 循环解决。-_-!
(了解至此我异常崩溃,由于要转换图片,数组的Lenght大约有20万条)。
不过有幸翻到了一个老外写的转换代码,非常好使,两行搞定,遂共享给大家:


byte[] bValue = new byte()[100];
sbyte[] sValue = (sbyte[])(Array)bValue;