Mul*_*iko 5 c# asp.net type-conversion
我试图将流(System.Net.ConnectStream)转换为字节数组.关于如何做到这一点的任何想法/例子?
Tho*_*que 12
Stream sourceStream = ... // the ConnectStream
byte[] array;
using (var ms = new MemoryStream())
{
sourceStream.CopyTo(ms);
array = ms.ToArray();
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
7686 次 |
| 最近记录: |