Try
Dim fs As New FileStream(zipPath, FileMode.Open)
Dim data(fs.Length) As Byte
fs.Read(data, 0, data.Length)
fs.Flush()
fs.Close()
'16进制转码
Dim sb As New StringBuilder
Dim i As Integer
For i = 0 To data.Length - 1
sb.AppendFormat("{0:x2}", data(i))
Next Catch ex As Exception
errNo = "-999999"
errInfo = Me.getErrorInfo(errNo)
End Try----------------------------------------------
哥哥们 帮忙把上面的代码转成C#的 谢谢了
Dim fs As New FileStream(zipPath, FileMode.Open)
Dim data(fs.Length) As Byte
fs.Read(data, 0, data.Length)
fs.Flush()
fs.Close()
'16进制转码
Dim sb As New StringBuilder
Dim i As Integer
For i = 0 To data.Length - 1
sb.AppendFormat("{0:x2}", data(i))
Next Catch ex As Exception
errNo = "-999999"
errInfo = Me.getErrorInfo(errNo)
End Try----------------------------------------------
哥哥们 帮忙把上面的代码转成C#的 谢谢了
打开文件zipPat,读出到byte数组data[]中;
把data[]数组按16进制转换为字符串sb.