掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ファイルをバイナリで読み込むには?? (ID:116428)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
別解。 FileStreamクラスのRead()メソッドの替わりに、 BinaryReaderクラスのReadBytes()メソッドを呼び出しています。 ==================== Dim FilePath As String = "C:\TEST.TXT" Dim DataFile As New System.IO.FileInfo(FilePath) If DataFile.Exists AndAlso DataFile.Length > 0 Then With New System.IO.BinaryReader(DataFile.OpenRead()) Me.TextBox1.Text = BitConverter.ToString(.ReadBytes(CInt(DataFile.Length))) .Close() End With Else Me.TextBox1.Clear() End If ====================
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.