日期:2014-05-17 浏览次数:20838 次
FileStream fs = new FileStream("1.wav",FileMode.Open,FileAccess.Read);
int tmp,cnt,row=0,col=16;
tmp=fs.ReadByte();
cnt = 1;
while (tmp != -1)
{
if (cnt == 1)
Console.Write("{0:X8} ", row * col);
Console.Write("{0:X2} ",tmp);
tmp = fs.ReadByte();
cnt++;
if (cnt == col+1)
{
Console.WriteLine();
cnt = 1;
row++;
}
}
public partial class Form1 : Form
{
public Form1()
{
TextBox consoleTextBox = new TextBox()
{
Multiline = true,
Font = new Font(FontFamily.GenericMonospace, 9),
Dock = DockStyle.Fill,
};
this.Controls.Add(consoleTextBox);
MyConsole.OnWrite = str =>
{
consoleTextBox.BeginInvoke((Action)delegate { consoleTextBox.AppendText(str); });
};
}
protected override void OnActivated(EventArgs e)
&nbs