Several methods such as OpenText and AppenText in .NET in system.io.fileinfo are used using UTF-8 encoding operation files. This causes files that are not written using UTF-8 encoding The garbled phenomenon will appear!!! Solution is to use byte stream operations for text files, ie without using OpenText and AppenText provided in .NET, the text is operated as binary files, and The corresponding decoding is performed using an Encoding method. Implementation code is as follows: Open text file: public function loadFile (Byval FileName As String) AS String if filename = "" the return "" End IF Try Dim FileReader as fileestream = file. Open (FileName, FileMode.Open) Dim FileByte (FileReader.Length) as Byte FileReader.Read (FileByte, 0, FileReader.Length) 'system converted into corresponding encoded characters Dim MyEncoder as encoding = Encoding.Default FileReader.Close () FileReader = Nothing return new string (myEncoder.getChars (filebyte)) Catch e as exception return "" End "" END TRY END SUB Save "" "Public Sub Savetofile (ByVal FileName As String) '/ * Conten string written content file FileName If FileName = "" Then Exit Sub End If Try Dim FileToWrite As FileStream = File.Create (FileName) Dim rByte () As Byte = Encoding.Default.GetBytes (Conten.ToCharArray) FileToWrite. Write (rbyte, 0, rbyte.length) filetowrite.close () FILETOWRITE = NOTHING CATCH E AS Exception End Try End Sub Using the above two methods You can implement the code operation text file corresponding to the current system. Avoid problem of garbled. ...