打开.bin文件,然后将其值放在文本框中 [英] Open .bin file then put its value on the textbox

查看:118
本文介绍了打开.bin文件,然后将其值放在文本框中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我从vb6迁移到vb.net。可以请某人解释如何执行此操作:打开.bin文件 - 然后将其值放在textbox或richtextbox或listbox上,重点是我需要能够通过UART发送该值



任何帮助表示感谢,谢谢



我的尝试:



Hello all good people. Im migrating from vb6 to vb.net. Can please someone explain how to do this action: Open .bin file - then put a value of it on textbox or richtextbox or listbox, the point is that i will need to be able to send that value through UART

Any help appreciate it, Thanks

What I have tried:

Private Sub open_Click()
     SaveFileDialog1.Filter = "bin files{*.bin)|*.bin"
     If SaveFileDialog1.ShowDialog = System.Windows.Forms.DialogResult.OK _
     Then
         My.Computer.FileSystem.WriteAllText _
         (SaveFileDialog1.FileName, TextBox7.Text, True)
     End If
 End Sub

推荐答案

使用 BinaryReader类(System.IO) [ ^ ]来读取文件乐。然后,您需要执行任何必要的处理,以便将二进制数据转换为可读文本,然后将其放入文本框中。
Use a BinaryReader Class (System.IO)[^] to read the file. You will then need to do whatever processing is necessary to make the binary data into readable text which you then put in the textbox.


这篇关于打开.bin文件,然后将其值放在文本框中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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