读取
Dim file As String = "d:\test.xls"
Dim fs As System.IO.FileStream = New System.IO.FileStream(file, System.IO.FileMode.Open)
Dim br As System.IO.BinaryReader = New System.IO.BinaryReader(fs)
Dim byTmp() As Byte = br.ReadBytes(fs.Length)
FileSys.WriteAllText("d:\temp.txt", System.Text.Encoding.Unicode.GetString(byTmp), False)
br.Close()
fs.Close()
fs.Dispose()
还原
Dim file As String = "d:\temp.txt"
Dim byTmp() As Byte = System.Text.Encoding.Unicode.GetBytes(FileSys.ReadAllText(file))
My.Computer.FileSystem.WriteAllBytes("d:\测试.xls", Bytmp, False)