加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

采用vb以十六进制的形式读取文本文档数据

发布时间:2020-12-16 22:20:34 所属栏目:大数据 来源:网络整理
导读:窗体上放入一个多行文本框(带纵向滚动条),一个命令按钮: Private Sub Command1_Click()Dim ss() As Byte,i As LongOpen "e:tmp123.txt" For Binary As #1ss = InputB(LOF(1),#1)Close #1For i = 0 To UBound(ss) If i 0 And (i Mod 16) = 0 Then Text1

窗体上放入一个多行文本框(带纵向滚动条),一个命令按钮:

Private Sub Command1_Click()

Dim ss() As Byte,i As Long

Open "e:tmp123.txt" For Binary As #1

ss = InputB(LOF(1),#1)

Close #1

For i = 0 To UBound(ss) 

	If i > 0 And (i Mod 16) = 0 Then 

		Text1.SelText = vbCrLf
		Text1.SelText = Right("0" & Hex(ss(i)),2) & " "
	endif
Next

End Sub

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读