>>Private Function UnicodeBytesToString( _ >> ByVal bytes() As Byte) _ >> As String >> >> Return System.Text.Encoding.Unicode.GetString(bytes) >>End Function >>>
> Dim lcText As String = "" > lcText = FileToStr("D:\Logo.jpg") > MessageBox.Show(lcText.Length.ToString) > oApp.CreateFile(lcText, "D:\Logo2.jpg") > > End Sub > > ' FileToStr() VFP equivalent > ' expC1 File name > Public Function FileToStr(ByVal tcFileName As String) As String > Dim loBinaryReader As IO.BinaryReader > Dim loByte() As Byte > Dim loFileStream As IO.FileStream > Dim lcString As String = "" > Try > loFileStream = New IO.FileStream(tcFileName, FileMode.Open, FileAccess.Read) > loBinaryReader = New IO.BinaryReader(loFileStream) > loByte = loBinaryReader.ReadBytes(CType(loFileStream.Length, Integer)) > lcString = UnicodeBytesToString(loByte) > loBinaryReader.Close() > loFileStream.Close() > Catch loError As Exception > System.Windows.Forms.MessageBox.Show(loError.Message) > lcString = "" > End Try > Return lcString > End Function > > Private Function UnicodeBytesToString(ByVal bytes() As Byte) As String > Return System.Text.Encoding.Unicode.GetString(bytes) > End Function >>