将字节数组保存到磁盘 [英] Saving byte array to disk

查看:82
本文介绍了将字节数组保存到磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将字节数组变量转储到磁盘时遇到问题.

数组很大,所以如果我使用立即窗口打印内容,那么我只能得到100个项目.

我可以获取它的地址(查看反汇编窗口和寄存器),因此可以在内存窗口中获取数据,但是如何从那里保存?

我认为,如果在调试会话循环到数组的元素并将它们保存到磁盘时可以创建并运行一些c#代码,这可能是一个很好的解决方案,但我不知道该怎么做.

谢谢
Piero

I have a problem when I try to dump a byte array variable to disk.

The array is big, so if I use the immediate window to print the content I obtain only 100 items.

I can obtain the address of it (looking the disassembly window and registers) and so I can get data in memory window, but how to save from there?

I think, if I could create and run some c# code when I am in debugging session cycling to the elements of the array and saving them to disk, this could be a good solution, but I don''t know how to do this.

Thank you
Piero

推荐答案

在监视窗口中输入以下内容(假设您的变量名称为bytearrayvariable):
In the watch window enter the following (assuming your variable name is bytearrayvariable) :
System.IO.File.WriteAllBytes("filename", bytearrayvariable)


这篇关于将字节数组保存到磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆