/
ivan
/
ModMas
Обзор
Документация
Войти
/
ivan
/
ModMas
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
ModuleMaster/app_code/bulkupload.vb
203 строки
7 KB
i.krivokon
Initial commit
13 мар 2026, 13:49
13 мар 2026, 13:49
00d9fb6
Код
Авторство
О чём код?
Imports System Imports System.Data Imports System.IO Imports Microsoft.VisualBasic Namespace BulkUpload Public Class BulkUpload Implements IDataReader Private _streamReader As StreamReader Private _currentLine As String Private _currentLineValues() As String Public separator As String = vbTab Public Sub New(filePath As String) _streamReader = New StreamReader(filePath) End Sub Public Sub Close() Implements IDataReader.Close _streamReader.Close() _currentLine = Nothing _currentLineValues = Nothing End Sub Public ReadOnly Property Depth As Integer Implements IDataReader.Depth Get Return Nothing End Get End Property Public Function GetSchemaTable() As DataTable Implements IDataReader.GetSchemaTable Return Nothing End Function Public ReadOnly Property IsClosed As Boolean Implements IDataReader.IsClosed Get Return Nothing End Get End Property Public Function NextResult() As Boolean Implements IDataReader.NextResult Return Nothing End Function Public Function Read() As Boolean Implements IDataReader.Read If _streamReader.EndOfStream Then Return False _currentLine = _streamReader.ReadLine _currentLineValues = _currentLine.Split(separator) Return True 'Read() End Function Public ReadOnly Property RecordsAffected As Integer Implements IDataReader.RecordsAffected Get Return Nothing End Get End Property Public ReadOnly Property FieldCount As Integer Implements IDataRecord.FieldCount Get Return _currentLineValues.Count End Get End Property Public Function GetBoolean(i As Integer) As Boolean Implements IDataRecord.GetBoolean Return Nothing End Function Public Function GetByte(i As Integer) As Byte Implements IDataRecord.GetByte Return Nothing End Function Public Function GetBytes(i As Integer, fieldOffset As Long, buffer() As Byte, bufferoffset As Integer, length As Integer) As Long Implements IDataRecord.GetBytes Return Nothing End Function Public Function GetChar(i As Integer) As Char Implements IDataRecord.GetChar Return Nothing End Function Public Function GetChars(i As Integer, fieldoffset As Long, buffer() As Char, bufferoffset As Integer, length As Integer) As Long Implements IDataRecord.GetChars Return Nothing End Function Public Function GetData(i As Integer) As IDataReader Implements IDataRecord.GetData Return Nothing End Function Public Function GetDataTypeName(i As Integer) As String Implements IDataRecord.GetDataTypeName Return Nothing End Function Public Function GetDateTime(i As Integer) As Date Implements IDataRecord.GetDateTime Return Nothing End Function Public Function GetDecimal(i As Integer) As Decimal Implements IDataRecord.GetDecimal Return Nothing End Function Public Function GetDouble(i As Integer) As Double Implements IDataRecord.GetDouble Return Nothing End Function Public Function GetFieldType(i As Integer) As Type Implements IDataRecord.GetFieldType Return Nothing End Function Public Function GetFloat(i As Integer) As Single Implements IDataRecord.GetFloat Return Nothing End Function Public Function GetGuid(i As Integer) As Guid Implements IDataRecord.GetGuid Return Nothing End Function Public Function GetInt16(i As Integer) As Short Implements IDataRecord.GetInt16 Return Nothing End Function Public Function GetInt32(i As Integer) As Integer Implements IDataRecord.GetInt32 Return Nothing End Function Public Function GetInt64(i As Integer) As Long Implements IDataRecord.GetInt64 Return Nothing End Function Public Function GetName(i As Integer) As String Implements IDataRecord.GetName Return Nothing End Function Public Function GetOrdinal(name As String) As Integer Implements IDataRecord.GetOrdinal Return Nothing End Function Public Function GetString(i As Integer) As String Implements IDataRecord.GetString Return Nothing End Function Public Function GetValue(i As Integer) As Object Implements IDataRecord.GetValue Try Return _currentLineValues(i) Catch ex As Exception Return Nothing End Try End Function Public Function GetValues(values() As Object) As Integer Implements IDataRecord.GetValues Return Nothing End Function Public Function IsDBNull(i As Integer) As Boolean Implements IDataRecord.IsDBNull Return Nothing End Function Default Public Overloads ReadOnly Property Item(i As Integer) As Object Implements IDataRecord.Item Get Return Nothing End Get End Property Default Public Overloads ReadOnly Property Item(name As String) As Object Implements IDataRecord.Item Get Return Nothing End Get End Property #Region "IDisposable Support" Private disposedValue As Boolean ' To detect redundant calls ' IDisposable Protected Overridable Sub Dispose(disposing As Boolean) If Not Me.disposedValue Then If disposing Then ' TODO: dispose managed state (managed objects). _streamReader.Close() End If ' TODO: free unmanaged resources (unmanaged objects) and override Finalize() below. ' TODO: set large fields to null. End If Me.disposedValue = True End Sub ' TODO: override Finalize() only if Dispose(ByVal disposing As Boolean) above has code to free unmanaged resources. 'Protected Overrides Sub Finalize() ' ' Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. ' Dispose(False) ' MyBase.Finalize() 'End Sub ' This code added by Visual Basic to correctly implement the disposable pattern. Public Sub Dispose() Implements IDisposable.Dispose ' Do not change this code. Put cleanup code in Dispose(disposing As Boolean) above. Dispose(True) GC.SuppressFinalize(Me) End Sub #End Region End Class End Namespace