【发布时间】:2012-12-10 14:52:24
【问题描述】:
我正在尝试使用 fstream 来编写一个可执行文件:
Dim buffer As String
Dim c As Char = Chr(9)
Dim fs As System.IO.FileStream = New System.IO.FileStream("test.exe", IO.FileMode.OpenOrCreate)
Dim w As System.IO.BinaryWriter = New System.IO.BinaryWriter(fs)
w.Seek(0, System.IO.SeekOrigin.Begin)
w.Write(HEX VALUES HERE)
w.Close()
fs.Close()
要将十六进制转换为 ASCII,我尝试了以下方法:
MessageBox.Show(ChrW(Convert.ToInt32("48", 16)))
MessageBox.Show(Chr(CInt("&H" & "48")))
MessageBox.Show(Chr(CInt("&H48")))
但是,这些函数中的每一个都只能使用单个字符。如何使这些函数适用于整个字符串?
【问题讨论】: