Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to read and write class files in VB.NET file stream

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to realize the stream reading and writing of VB.NET files, which is very detailed and has certain reference value. Friends who are interested must finish reading!

VB.NET file stream code:

Option Explicit Private m_strFilePath As String Private m_intFileNum As Integer Private m_bytBuffer () As Byte Public Property Get FilePath () As String FilePath = m_strFilePath End Property Public Property Let FilePath (ByVal strFilePath As String) m_strFilePath = strFilePath End Property Public Property Get EOS () As Boolean If Ready () Then EOS = EOF (m_intFileNum) Else EOS = True End If End Property Public Property Get Ready () As Boolean Ready = m_intFileNum 0 End Property Public Function CloseFile () As Boolean If Ready () Then Close # M_intFileNum m_intFileNum = 0 CloseFile = True Else CloseFile = False End If End Function Public Function OpenFile () As Boolean On Error Goto HandleError CloseFile m_intFileNum = FreeFile Open m_strFilePath For Binary As # m_intFileNum OpenFile = True Exit Function HandleError: OpenFile = False End Function Public Property Get Position () As Long If Ready () Then Position = Loc (m_intFileNum) Else Position =-1 End If End Property Public Property Let Position (ByVal lngPosition As Long) If Ready () Then If lngPosition > 0 And lngPosition 0 And lngCount + Loc (m_intFileNum)-1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report