Home > Software engineering >  VB binary save the problem, a great god
VB binary save the problem, a great god

Time:10-29

TXTBOX box "hello" is the content of the
Inside the box content according to the binary saved to a text file "123. TXT"
Code should be how to write?
I find the Internet for two days, did not find a good way

CodePudding user response:

 f=freefile () 
123. TXT "open" for the output as # f
Print # f, TXTBOX. Text
Close # f

CodePudding user response:

Recommended WinHex software to check the hard disk or file or original bytes of memory content,

CodePudding user response:

Guess you mean
Want to put the text into a binary ASCII code expressly to TXT again?

Such as input A
Ascii (A)=Hex (41)=Bin (1000001)
TXT text is represented in 1000001

CodePudding user response:

"According to the binary save" what meaning be?

All the data are based on the preservation and transmission of binary code, is nothing but a notepad software in open the TXT file by default when the data according to ASCII code to explain, so we see the text,

With the software to open it, such as application UltraEdit you choose, according to the binary code to see its true colours,

CodePudding user response:

123. TXT "Open" For Binary As # 1
Put # 1, TXTBOX. Text
Close # 1

CodePudding user response:

I am a new study

CodePudding user response:

 
Dim fd As an Integer, _
ByArray () As Byte
'//to convert a string into an array of bytes
ByArray=StrConv (text1. Text, vbFromUnicode)
'//a valid file number
Fd=FreeFile ()
'//in binary mode to open the specified file, the file does not exist, create a file
The Open yourfile. TXT "For Binary As # fd
'//output byte array of data to the location of the file read and write the current file (the default is beginning)
Put # fd, byArray
'//close the file
Close # fd

CodePudding user response:

This article has a custom function called SaveTextFile, you can have a look at
http://blog.csdn.net/supermanking/article/details/5989227
  • Related