初始化
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/bin
|
||||
BIN
.vs/DataPresentationManager/v16/.suo
Normal file
BIN
.vs/DataPresentationManager/v16/.suo
Normal file
Binary file not shown.
41
App.config
Normal file
41
App.config
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="deviceparsingdatalog.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Hash.xxHash" publicKeyToken="32cd54395057cec3" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.0.7.0" newVersion="1.0.7.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="K4os.Compression.LZ4.Streams" publicKeyToken="2186fa9121ef231d" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.2.16.0" newVersion="1.2.16.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<userSettings>
|
||||
<deviceparsingdatalog.My.MySettings>
|
||||
<setting name="FileDir" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
<setting name="fastLineName" serializeAs="String">
|
||||
<value />
|
||||
</setting>
|
||||
</deviceparsingdatalog.My.MySettings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
176
ApplicationLog.vb
Normal file
176
ApplicationLog.vb
Normal file
@@ -0,0 +1,176 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.IO
|
||||
Imports System.Text
|
||||
|
||||
Namespace AdminLog
|
||||
|
||||
''' <summary>
|
||||
''' 应用程序日志
|
||||
''' </summary>
|
||||
Public NotInheritable Class ApplicationLog
|
||||
|
||||
''' <summary>
|
||||
''' 日志类型
|
||||
''' </summary>
|
||||
Public Enum LogType
|
||||
''' <summary> 堆栈跟踪信息 </summary>
|
||||
Trace
|
||||
''' <summary> 警告信息 </summary>
|
||||
Warning
|
||||
''' <summary> 错误信息应该包含对象名、发生错误点所在的方法名称、具体错误信息 </summary>
|
||||
[Error]
|
||||
''' <summary> 与数据库相关的信息 </summary>
|
||||
Database
|
||||
End Enum
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 日志文件所在父文件夹路径
|
||||
''' </summary>
|
||||
Private Shared _logPath As String = My.Application.Info.DirectoryPath
|
||||
|
||||
''' <summary>
|
||||
''' 日志文件名前缀
|
||||
''' </summary>
|
||||
Private Shared _logFilePrefix As String = "Log"
|
||||
|
||||
''' <summary>
|
||||
''' 日志文件所在路径
|
||||
''' </summary>
|
||||
Private Shared _logFilePath As String = $"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 保存日志的文件夹完整路径
|
||||
''' </summary>
|
||||
Public Shared Property LogDirPath As String
|
||||
Get
|
||||
If Equals(_logPath, String.Empty) Then
|
||||
_logPath = My.Application.Info.DirectoryPath
|
||||
End If
|
||||
Return _logPath
|
||||
End Get
|
||||
Set(ByVal value As String)
|
||||
_logPath = value
|
||||
|
||||
_logFilePath = $"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 日志文件前缀
|
||||
''' </summary>
|
||||
Public Shared Property LogFilePrefix As String
|
||||
Get
|
||||
Return _logFilePrefix
|
||||
End Get
|
||||
Set(value As String)
|
||||
_logFilePrefix = value
|
||||
_logFilePath = $"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log"
|
||||
End Set
|
||||
End Property
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 日志文件路径
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared ReadOnly Property LogFilePath() As String
|
||||
Get
|
||||
Return _logFilePath
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 写入错误信息记录日志
|
||||
''' </summary>
|
||||
''' <param name="ex"></param>
|
||||
Public Shared Sub WriteErrorLog(ex As Exception)
|
||||
Dim msg As New StringBuilder
|
||||
msg.Append($"ErrorMessage:{ex.Message}{vbNewLine}")
|
||||
msg.Append($"ErrorTime:{Now}{vbNewLine}")
|
||||
msg.Append($"ErrorSource:{ex.Source}{vbNewLine}")
|
||||
msg.Append($"ErrorType:{ex.GetType}{vbNewLine}")
|
||||
msg.Append($"ErrorTargetSite:{ex.TargetSite}{vbNewLine}")
|
||||
msg.Append($"ErrorStackTrace:{ex.StackTrace}{vbNewLine}")
|
||||
WriteLog(LogType.Error, msg.ToString())
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 写入错误信息记录日志
|
||||
''' </summary>
|
||||
''' <param name="msg"></param>
|
||||
Public Shared Sub WriteErrorLog(msg As String)
|
||||
WriteLog(LogType.Error, msg.ToString())
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 写入流程信息记录日志
|
||||
''' </summary>
|
||||
''' <param name="msg"></param>
|
||||
Public Shared Sub WriteTraceLog(msg As String)
|
||||
WriteLog(LogType.Trace, msg.ToString())
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 写入警告信息记录日志
|
||||
''' </summary>
|
||||
''' <param name="msg"></param>
|
||||
Public Shared Sub WriteWarningLog(msg As String)
|
||||
WriteLog(LogType.Warning, msg.ToString())
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 写入数据库信息记录日志
|
||||
''' </summary>
|
||||
''' <param name="msg"></param>
|
||||
Public Shared Sub WriteDatabaseLog(msg As String)
|
||||
WriteLog(LogType.Database, msg.ToString())
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 日志锁,防止多线程同时写日志导致冲突
|
||||
''' </summary>
|
||||
Private Shared ReadOnly LogLock As New Object()
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 将信息入到日志
|
||||
''' </summary>
|
||||
''' <param name="logType">日志类型</param>
|
||||
''' <param name="msg">日志内容</param>
|
||||
Public Shared Sub WriteLog(logType As String, msg As String)
|
||||
'写入记录入日志文件
|
||||
SyncLock LogLock
|
||||
Try
|
||||
Dim logString As New StringBuilder
|
||||
logString.Append($"[{Date.Now.ToString("yyyy-MM-dd HH:mm:ss:fff ")}]")
|
||||
logString.Append($"[{logType.PadRight(8)}]")
|
||||
logString.Append(msg)
|
||||
|
||||
Using sw As StreamWriter = File.AppendText($"{LogDirPath}{Path.DirectorySeparatorChar}{LogFilePrefix}_{Date.Now:yyyyMMdd}.Log")
|
||||
sw.WriteLine(logString.ToString())
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
Console.WriteLine($"Uts WriteLog Error:{ex.Message}")
|
||||
End Try
|
||||
End SyncLock
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 写入日志到本地
|
||||
''' </summary>
|
||||
Public Shared Sub WriteLog(type As LogType, ByVal msg As String)
|
||||
WriteLog(type.ToString(), msg)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
37
C5_MUSIC.Designer.vb
generated
Normal file
37
C5_MUSIC.Designer.vb
generated
Normal file
@@ -0,0 +1,37 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class C5_MUSIC
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'C5_MUSIC
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Name = "C5_MUSIC"
|
||||
Me.Text = "C5_MUSIC"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
120
C5_MUSIC.resx
Normal file
120
C5_MUSIC.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
981
C5_MUSIC.vb
Normal file
981
C5_MUSIC.vb
Normal file
@@ -0,0 +1,981 @@
|
||||
Imports System.Text
|
||||
|
||||
Public Class C5_MUSIC
|
||||
Enum MUSICFunction
|
||||
Current_Playback_Status = 1 '查询当前播放状态
|
||||
Set_Volume_parameters '设定音量默认参数
|
||||
Specify_play_state '指定播放状态
|
||||
Set_volume '设定音量
|
||||
Current_Volume_parameters '查询音量默认参数
|
||||
Current_Volume '查询音量
|
||||
Set_cycle_mode '设定循环模式
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' C5_MUSIC类型数据
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Parsing_C5_MUSIC_DATA(data_count As Byte(), ByRef MUSIC As List(Of String)) As List(Of String)
|
||||
Try
|
||||
Dim C5_MUSIC As String = ""
|
||||
Dim MUSIC_CMD As Byte = data_count(7)
|
||||
Select Case MUSIC_CMD
|
||||
Case &H20
|
||||
MUSIC.Add("C5_MUSIC--查询当前播放状态")
|
||||
C5_MUSIC = Current_Playback_Status(data_count, MUSIC)
|
||||
Case &H30
|
||||
MUSIC.Add("C5_MUSIC--查询当前播放状态")
|
||||
C5_MUSIC = Current_Playback_Status(data_count, MUSIC)
|
||||
Case &H21
|
||||
MUSIC.Add("C5_MUSIC--设定音量默认参数")
|
||||
C5_MUSIC = Set_Volume_parameters(data_count, MUSIC)
|
||||
Case &H31
|
||||
MUSIC.Add("C5_MUSIC--设定音量默认参数")
|
||||
C5_MUSIC = Set_Volume_parameters(data_count, MUSIC)
|
||||
Case &H22
|
||||
MUSIC.Add("C5_MUSIC--指定播放状态")
|
||||
C5_MUSIC = Specify_play_state(data_count, MUSIC)
|
||||
Case &H32
|
||||
MUSIC.Add("C5_MUSIC--指定播放状态")
|
||||
C5_MUSIC = Specify_play_state(data_count, MUSIC)
|
||||
Case &H23
|
||||
MUSIC.Add("C5_MUSIC--设定音量")
|
||||
C5_MUSIC = Set_volume(data_count, MUSIC)
|
||||
Case &H33
|
||||
MUSIC.Add("C5_MUSIC--设定音量")
|
||||
C5_MUSIC = Set_volume(data_count, MUSIC)
|
||||
Case &H24
|
||||
MUSIC.Add("C5_MUSIC--查询音量默认参数")
|
||||
C5_MUSIC = Current_Volume_parameters(data_count, MUSIC)
|
||||
Case &H34
|
||||
MUSIC.Add("C5_MUSIC--查询音量默认参数")
|
||||
C5_MUSIC = Current_Volume_parameters(data_count, MUSIC)
|
||||
Case &H26
|
||||
MUSIC.Add("C5_MUSIC--查询音量")
|
||||
C5_MUSIC = Current_Volume(data_count, MUSIC)
|
||||
Case &H36
|
||||
MUSIC.Add("C5_MUSIC--查询音量")
|
||||
C5_MUSIC = Current_Volume(data_count, MUSIC)
|
||||
Case &H29
|
||||
MUSIC.Add("C5_MUSIC--设定循环模式")
|
||||
C5_MUSIC = Set_cycle_mode(data_count, MUSIC)
|
||||
Case &H39
|
||||
MUSIC.Add("C5_MUSIC--设定循环模式")
|
||||
C5_MUSIC = Set_cycle_mode(data_count, MUSIC)
|
||||
End Select
|
||||
MUSIC.Add($"{C5_MUSIC}")
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
|
||||
#Region "C5_MUSIC数据内容解析"
|
||||
|
||||
|
||||
#Region "查询当前播放状态"
|
||||
|
||||
''' <summary>
|
||||
''' 查询当前播放状态
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Current_Playback_Status(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
|
||||
Dim direction As Byte = data_count(7)
|
||||
Select Case direction
|
||||
Case &H20
|
||||
MUSIC.Add("发送")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh};")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh};")
|
||||
End If
|
||||
Case &H30
|
||||
MUSIC.Add("回复")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh};")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh};")
|
||||
End If
|
||||
str = reply_ErrCode(data_count, str)
|
||||
Case Else
|
||||
MUSIC.Add("未知")
|
||||
Return str.ToString
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' ErrCode
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function reply_ErrCode(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim errcode As Byte = data_count(8)
|
||||
Select Case errcode
|
||||
Case &HE0
|
||||
If data_count.Count > 9 Then
|
||||
MUSIC = Music_playing_state(data_count, MUSIC)
|
||||
End If
|
||||
|
||||
Case &HE1
|
||||
MUSIC.Append(" ErrCode:校验错误")
|
||||
Case &HE2
|
||||
MUSIC.Append(" ErrCode:命令错误")
|
||||
Case &HE3
|
||||
MUSIC.Append(" ErrCode:参数错误")
|
||||
Case &HE4
|
||||
MUSIC.Append(" ErrCode:其他错误")
|
||||
Case Else
|
||||
MUSIC.Append(" ErrCode:未知错误")
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 房间音乐播放状态
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Music_playing_state(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim playsingstate As Byte = data_count(9)
|
||||
Select Case playsingstate
|
||||
Case &H1
|
||||
MUSIC.Append("播放状态:暂停;")
|
||||
Case &H0
|
||||
MUSIC.Append("播放状态:播放中;")
|
||||
End Select
|
||||
MUSIC = Music_cucle_model(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
Return MUSIC
|
||||
End Try
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 播放循环模式
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Music_cucle_model(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim cuclemodel As Byte = data_count(10)
|
||||
Select Case cuclemodel
|
||||
Case &H0
|
||||
MUSIC.Append(" 播放模式:全部循环;")
|
||||
Case &H1
|
||||
MUSIC.Append(" 播放模式:单曲循环;")
|
||||
Case &H2
|
||||
MUSIC.Append(" 播放模式:文件夹循环;")
|
||||
Case &H3
|
||||
MUSIC.Append(" 播放模式:随机播放;")
|
||||
Case &H5
|
||||
MUSIC.Append(" 播放模式:顺序播放;")
|
||||
End Select
|
||||
MUSIC = Music_Folder_Name(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
Return MUSIC
|
||||
End Try
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 文件夹号
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Music_Folder_Name(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim foldername As Byte = data_count(11)
|
||||
Select Case foldername
|
||||
Case &H0
|
||||
MUSIC.Append(" 文件夹号:音乐文件夹;")
|
||||
Case &H1
|
||||
MUSIC.Append(" 文件夹号:提示音文件夹;")
|
||||
Case &H2
|
||||
MUSIC.Append(" 文件夹号:助眠文件夹;")
|
||||
Case &H3
|
||||
MUSIC.Append(" 文件夹号:门铃文件夹;")
|
||||
Case &H4
|
||||
MUSIC.Append(" 文件夹号:欢迎词文件夹;")
|
||||
End Select
|
||||
Dim filename As String = Format(data_count(12), "000")
|
||||
MUSIC.Append($"音乐文件名:{filename};")
|
||||
MUSIC = Music_File_serialnumber(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
Return MUSIC
|
||||
End Try
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 文件序号
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Music_File_serialnumber(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim serialnumber_H As Byte = data_count(13)
|
||||
Dim serialnumber_L As Byte = data_count(14)
|
||||
MUSIC.Append($" 文件序号:{serialnumber_H + serialnumber_L};")
|
||||
Music_Realtime_volume(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
Return MUSIC
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 实时音量
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Music_Realtime_volume(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim volumemute_bit7 As Byte = (data_count(15) >> 7) And &H1
|
||||
If volumemute_bit7 = 0 Then
|
||||
MUSIC.Append(" 静音;")
|
||||
ElseIf volumemute_bit7 = 1 Then
|
||||
MUSIC.Append(" 未静音;")
|
||||
End If
|
||||
Dim volumemute_bit As Byte = data_count(15) And &H7F
|
||||
MUSIC.Append($" 音量:{volumemute_bit};")
|
||||
Dim Percentage_volume As Byte = data_count(16)
|
||||
Dim Loop_volume1 As Byte = data_count(17)
|
||||
Dim Loop_volume2 As Byte = data_count(18)
|
||||
Dim Loop_volume3 As Byte = data_count(19)
|
||||
MUSIC.Append($" 全局百分比音量:{Percentage_volume},")
|
||||
MUSIC.Append($"音乐音量:{Loop_volume1},")
|
||||
MUSIC.Append($"提示音音量:{Loop_volume2},")
|
||||
MUSIC.Append($"门铃音量:{Loop_volume3};")
|
||||
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
Return MUSIC
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "设定音量默认参数"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 设定音量默认参数
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Set_Volume_parameters(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
Dim direction As Byte = data_count(7)
|
||||
Select Case direction
|
||||
Case &H21
|
||||
MUSIC.Add("发送")
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
|
||||
Dim Music_default_volume As Byte = data_count(8)
|
||||
Dim Music_MAX_volume As Byte = data_count(9)
|
||||
Dim Music_Min_volume As Byte = data_count(10)
|
||||
str.Append($"默认音量:{Music_default_volume}")
|
||||
str.Append($"最大音量:{Music_MAX_volume}")
|
||||
str.Append($"最小音量:{Music_Min_volume}(不支持设置)")
|
||||
str.Append($"提示音音量:0")
|
||||
str.Append($"门铃音量:0")
|
||||
Case &H31
|
||||
MUSIC.Add("回复")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh}")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh}")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh}")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh}")
|
||||
End If
|
||||
Dim ErrCode As Byte = data_count(8)
|
||||
Select Case ErrCode
|
||||
Case &HE0
|
||||
|
||||
Case &HE1
|
||||
str.Append("校验错误")
|
||||
Case &HE2
|
||||
str.Append("命令错误")
|
||||
Case &HE3
|
||||
str.Append("参数错误")
|
||||
Case &HE4
|
||||
str.Append("其他错误")
|
||||
Case Else
|
||||
str.Append("未知错误")
|
||||
End Select
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "指定播放状态"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定播放状态
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Specify_play_state(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
Dim dirction As Byte = data_count(7)
|
||||
Select Case dirction
|
||||
Case &H22
|
||||
MUSIC.Add("发送")
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
|
||||
Dim Music_room As Byte = data_count(8)
|
||||
If Music_room = &H1 Then
|
||||
str.Append("房间音乐")
|
||||
Dim play_state As Byte = data_count(9)
|
||||
Select Case play_state
|
||||
Case &H0
|
||||
str.Append("播放状态:播放;")
|
||||
Case &H1
|
||||
str.Append("播放状态:暂停;")
|
||||
Case &H2
|
||||
str.Append("播放状态:停止;")
|
||||
Case &H3
|
||||
str.Append("播放状态:下一曲;")
|
||||
Case &H4
|
||||
str.Append("播放状态:上一曲;")
|
||||
Case &H5
|
||||
str.Append("播放状态:快进;")
|
||||
Case &H6
|
||||
str.Append("播放状态:快退;")
|
||||
Case &H7
|
||||
str.Append("播放状态:单曲播放;")
|
||||
Case &H8
|
||||
str.Append("播放状态:抢先播放;")
|
||||
End Select
|
||||
str = Room_Folder_Name(data_count, str)
|
||||
Else
|
||||
str.Append("暂无此播放器")
|
||||
End If
|
||||
Case &H32
|
||||
MUSIC.Add("回复")
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
|
||||
Dim ErrCode As Byte = data_count(8)
|
||||
Select Case ErrCode
|
||||
Case &HE0
|
||||
str.Append("无错误;")
|
||||
Case &HE1
|
||||
str.Append("校验错误;")
|
||||
Case &HE2
|
||||
str.Append("命令错误;")
|
||||
Case &HE3
|
||||
str.Append("参数错误;")
|
||||
Case &HE4
|
||||
str.Append("其他错误;")
|
||||
Case Else
|
||||
str.Append("未知错误;")
|
||||
End Select
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 房间音乐文件夹名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Room_Folder_Name(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim foldername As Byte = data_count(10)
|
||||
Select Case foldername
|
||||
Case &H0
|
||||
MUSIC.Append(" 文件夹名:音乐文件夹,")
|
||||
Case &H1
|
||||
MUSIC.Append(" 文件夹名:提示音文件夹,")
|
||||
Case &H2
|
||||
MUSIC.Append(" 文件夹名:助眠文件夹,")
|
||||
Case &H3
|
||||
MUSIC.Append(" 文件夹名:门铃文件夹,")
|
||||
Case &H4
|
||||
MUSIC.Append(" 文件夹名:欢迎词文件夹,")
|
||||
Case &H5
|
||||
MUSIC.Append(" 文件夹名:冥想助眠,")
|
||||
Case &H6
|
||||
MUSIC.Append(" 文件夹名:海浪助眠,")
|
||||
Case &H7
|
||||
MUSIC.Append(" 文件夹名:森林助眠,")
|
||||
End Select
|
||||
MUSIC = Room_File_Name(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 房间音乐-文件名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Room_File_Name(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim filename As String = Format(data_count(11), "000")
|
||||
MUSIC.Append($"文件名:{filename},")
|
||||
MUSIC = Room_File_Type(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 房间音乐-文件类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Room_File_Type(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim filetype As Byte = (data_count(12) >> 7) And &H1
|
||||
Select Case filetype
|
||||
Case &H0
|
||||
MUSIC.Append("文件类型:mp3;")
|
||||
Case &H1
|
||||
MUSIC.Append("文件类型:wav;")
|
||||
End Select
|
||||
MUSIC = Room_Up_volume_gradient(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 上升音量渐变
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Room_Up_volume_gradient(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim Up_volume_gradient_H As Byte = data_count(13)
|
||||
Dim Up_volume_gradient_L As Byte = data_count(14)
|
||||
MUSIC.Append($" 助眠播放上升阶段总时间:{Up_volume_gradient_H + Up_volume_gradient_L}s,")
|
||||
MUSIC = Room_Drop_volume_gradient(data_count, MUSIC)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 下降音量渐变
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Room_Drop_volume_gradient(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim Drop_volume_gradient_H As Byte = data_count(13)
|
||||
Dim Drop_volume_gradient_L As Byte = data_count(14)
|
||||
MUSIC.Append($"助眠播放下降阶段总时间:{Drop_volume_gradient_H + Drop_volume_gradient_L}s,")
|
||||
Dim maxvolume As Byte = data_count(15)
|
||||
Dim minvolume As Byte = data_count(16)
|
||||
MUSIC.Append($"助眠最高音量:{maxvolume},")
|
||||
MUSIC.Append($"助眠最低音量:{minvolume};")
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "设定音量"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 设定音量
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Set_volume(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
Dim volume_cmd As Byte = data_count(7)
|
||||
Select Case volume_cmd
|
||||
Case &H23
|
||||
MUSIC.Add("发送")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
|
||||
|
||||
Dim specify_player As Byte = data_count(8)
|
||||
Select Case specify_player
|
||||
Case &H1
|
||||
str.Append("指定播放器:房间音乐")
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
str = Set_adjustment_mode(data_count, str)
|
||||
Case &H33
|
||||
MUSIC.Add("回复")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
Dim ErrCode As Byte = data_count(8)
|
||||
Select Case ErrCode
|
||||
Case &HE0
|
||||
Case &HE1
|
||||
str.Append("校验错误")
|
||||
Case &HE2
|
||||
str.Append("命令错误")
|
||||
Case &HE3
|
||||
str.Append("参数错误")
|
||||
Case &HE4
|
||||
str.Append("其他错误")
|
||||
Case Else
|
||||
str.Append("未知错误")
|
||||
End Select
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 设定调节模式
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Set_adjustment_mode(data_count As Byte(), MUSIC As StringBuilder) As StringBuilder
|
||||
|
||||
Try
|
||||
Dim mode As Byte = data_count(9)
|
||||
Dim str As String() = BitConverter.ToString(data_count, 10).Split("-")
|
||||
Dim Absolute_volume As String = str(0)
|
||||
Dim Global_percentage As String = str(1)
|
||||
Dim mute_volume As String = str(2)
|
||||
Dim relative_volume As String = str(3)
|
||||
Dim relative_volume_Loop As String = str(4)
|
||||
Dim loop_volume1 As String = str(5)
|
||||
Dim loop_volume2 As String = str(6)
|
||||
Dim loop_volume3 As String = str(7)
|
||||
|
||||
MUSIC.Append("设定调节模式:")
|
||||
MUSIC.Append($"绝对音量值:{Absolute_volume},")
|
||||
MUSIC.Append($"全局百分比:{Global_percentage},")
|
||||
MUSIC.Append($"静音:{mute_volume},")
|
||||
MUSIC.Append($"相对音量操作:{relative_volume},")
|
||||
MUSIC.Append($"相对音量操作回路:{relative_volume_Loop},")
|
||||
MUSIC.Append($"音乐回路:{loop_volume1},")
|
||||
MUSIC.Append($"提示音回路:{loop_volume2},")
|
||||
MUSIC.Append($"门铃回路:{loop_volume3};")
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return MUSIC
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "查询音量默认参数"
|
||||
''' <summary>
|
||||
''' 查询音量默认参数
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Current_Volume_parameters(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
Dim volume_cmd As Byte = data_count(7)
|
||||
Select Case volume_cmd
|
||||
Case &H24
|
||||
MUSIC.Add("发送")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
|
||||
Case &H34
|
||||
MUSIC.Add("回复")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh},")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh},")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh},")
|
||||
End If
|
||||
str = Current_Volume_ErrCode(data_count, str)
|
||||
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' ErrCode
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="str"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Current_Volume_ErrCode(data_count As Byte(), str As StringBuilder) As StringBuilder
|
||||
Dim ErrCode As Byte = data_count(8)
|
||||
Try
|
||||
Select Case ErrCode
|
||||
Case &HE0
|
||||
Case &HE1
|
||||
str.Append("校验错误")
|
||||
Case &HE2
|
||||
str.Append("命令错误")
|
||||
Case &HE3
|
||||
str.Append("参数错误")
|
||||
Case &HE4
|
||||
str.Append("其他错误")
|
||||
Case Else
|
||||
str.Append("未知错误")
|
||||
End Select
|
||||
Dim defaultvolume As String = $"默认音量:{data_count(9)},"
|
||||
Dim maxvolume As String = $"最大音量:{data_count(10)},"
|
||||
Dim minvolume As String = $"最小音量:{data_count(11)},"
|
||||
Dim promptvolume As String = $"提示音音量:{data_count(12)},"
|
||||
Dim doorbellvolume As String = $"门铃音量:{data_count(13)};"
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "查询音量"
|
||||
''' <summary>
|
||||
''' 查询音量
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Current_Volume(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
Dim direction As Byte = data_count(7)
|
||||
Select Case direction
|
||||
Case &H26
|
||||
MUSIC.Add("发送")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh};")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh};")
|
||||
End If
|
||||
Case &H36
|
||||
MUSIC.Add("回复")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh};")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh};")
|
||||
End If
|
||||
Dim ErrCode As Byte = data_count(8)
|
||||
Select Case ErrCode
|
||||
Case &HE0
|
||||
|
||||
Case &HE1
|
||||
str.Append("校验错误")
|
||||
Case &HE2
|
||||
str.Append("命令错误")
|
||||
Case &HE3
|
||||
str.Append("参数错误")
|
||||
Case &HE4
|
||||
str.Append("其他错误")
|
||||
End Select
|
||||
Dim currentvolume As Byte = $" 当前音量:{data_count(9)};"
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "设定循环模式"
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 设定循环模式
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="MUSIC"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Set_cycle_mode(data_count As Byte(), ByRef MUSIC As List(Of String)) As String
|
||||
Dim str As New StringBuilder
|
||||
Try
|
||||
Dim direction As Byte = data_count(7)
|
||||
Select Case direction
|
||||
Case &H29
|
||||
MUSIC.Add("发送")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh};")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh};")
|
||||
End If
|
||||
str = Set_cycle_mode_Specify_player(data_count, str)
|
||||
|
||||
Case &H39
|
||||
MUSIC.Add("回复")
|
||||
Dim Playback_Type As Byte = data_count(1)
|
||||
Dim v As Byte = (data_count(1) >> 6) And &H3
|
||||
Dim xh As Byte = data_count(1) And &HF
|
||||
If v = &H0 Then
|
||||
str.Append($"(首发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H1 Then
|
||||
str.Append($"(首发,群发)发送序号:{xh};")
|
||||
ElseIf v = &H2 Then
|
||||
str.Append($"(重发,单发)发送序号:{xh};")
|
||||
ElseIf v = &H3 Then
|
||||
str.Append($"(重发,群发)发送序号:{xh};")
|
||||
End If
|
||||
Dim ErrCode As Byte = data_count(8)
|
||||
Select Case ErrCode
|
||||
Case &HE0
|
||||
str.Append("无错误;")
|
||||
Case &HE1
|
||||
str.Append("校验错误")
|
||||
Case &HE2
|
||||
str.Append("命令错误")
|
||||
Case Else
|
||||
|
||||
End Select
|
||||
Case Else
|
||||
MUSIC.Add("未知")
|
||||
Return str.ToString
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str.ToString
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定播放器
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="str"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Set_cycle_mode_Specify_player(data_count As Byte(), str As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim specifyplayer As Byte = data_count(8)
|
||||
Select Case specifyplayer
|
||||
Case &H1
|
||||
str.Append("房间音乐:")
|
||||
Case &H2
|
||||
str.Append("洗手间音乐:")
|
||||
Case &H3
|
||||
str.Append("房间和洗手间:")
|
||||
Case &H4
|
||||
str.Append("门铃:")
|
||||
End Select
|
||||
str = Specify_cycle_mode(data_count, str)
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
Return str
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定循环模式
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <param name="str"></param>
|
||||
''' <returns></returns>
|
||||
Public Function Specify_cycle_mode(data_count As Byte(), str As StringBuilder) As StringBuilder
|
||||
Try
|
||||
Dim Specifycyclemode As Byte = data_count(9)
|
||||
Select Case Specifycyclemode
|
||||
Case &H0
|
||||
str.Append("全部循环;")
|
||||
Case &H1
|
||||
str.Append("单曲循环;")
|
||||
Case &H2
|
||||
str.Append("文件夹循环;")
|
||||
Case &H3
|
||||
str.Append("随机播放;")
|
||||
Case &H5
|
||||
str.Append("顺序播放;")
|
||||
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
Return str
|
||||
End Function
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
#End Region
|
||||
|
||||
Private Sub C5_MUSIC_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
37
CS_IO_Type.designer.vb
generated
Normal file
37
CS_IO_Type.designer.vb
generated
Normal file
@@ -0,0 +1,37 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class CS_IO
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'CS_IO
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Name = "CS_IO"
|
||||
Me.Text = "CS_IO"
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
End Class
|
||||
120
CS_IO_Type.resx
Normal file
120
CS_IO_Type.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
3006
CS_IO_Type.vb
Normal file
3006
CS_IO_Type.vb
Normal file
File diff suppressed because it is too large
Load Diff
25
DataPresentationManager.sln
Normal file
25
DataPresentationManager.sln
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.32602.291
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "deviceparsingdatalog", "deviceparsingdatalog.vbproj", "{2A8EB503-36FA-421A-A4A5-1B926E048EC4}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{2A8EB503-36FA-421A-A4A5-1B926E048EC4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{2A8EB503-36FA-421A-A4A5-1B926E048EC4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{2A8EB503-36FA-421A-A4A5-1B926E048EC4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{2A8EB503-36FA-421A-A4A5-1B926E048EC4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {C3CAFA0B-7298-4C7B-A009-EFA013204C64}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
179
DataTypes.vb
Normal file
179
DataTypes.vb
Normal file
@@ -0,0 +1,179 @@
|
||||
|
||||
Imports System.Text
|
||||
|
||||
|
||||
Public Class DataTypes
|
||||
|
||||
Public Shared Sub Parsing_485Data_type(data_count As Byte(), ByRef Type_Param As List(Of String))
|
||||
Dim CSIO As New CS_IO_Type
|
||||
'数据解析是否合法, 校验数据的类型
|
||||
If Parsing_C5_MUSIC(data_count) = True Then
|
||||
C5_MUSIC.Parsing_C5_MUSIC_DATA(data_count, Type_Param)
|
||||
ElseIf Parsing_CS_IO(data_count) = True Then
|
||||
CSIO.Parsing_CS_IO_DATA(data_count, Type_Param)
|
||||
Else
|
||||
Console.WriteLine("校验数据类型失败")
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 解析C5_MUSIC数据
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function Parsing_C5_MUSIC(data_count As Byte()) As Boolean
|
||||
Try
|
||||
Dim sum As UInt32 = data_count.Length
|
||||
If GetSumCheckMod(data_count, sum) = &H0 Then
|
||||
Dim len As UInt32 = data_count.Count
|
||||
If len = (data_count(5) + data_count(4)) Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 解析CS_IO数据
|
||||
''' </summary>
|
||||
''' <param name="data_count"></param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function Parsing_CS_IO(data_count As Byte()) As Boolean
|
||||
Try
|
||||
Dim sum As UInt32 = data_count.Length
|
||||
If GetSumCheckMod(data_count, sum) = &H0 Then
|
||||
Dim len As UInt32 = data_count.Count
|
||||
If len = data_count(4) Then
|
||||
Return True
|
||||
End If
|
||||
End If
|
||||
Catch ex As Exception
|
||||
Return False
|
||||
AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
''' 和校验取余数
|
||||
''' 求Byte数组的和校验取余数
|
||||
''' </summary>
|
||||
''' <param name="dataPacket">Byte数组</param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function GetSumCheckMod(dataPacket As Byte(), datalen As Byte) As Byte
|
||||
Dim sum As Integer
|
||||
For idx = 0 To datalen - 1
|
||||
sum += dataPacket(idx)
|
||||
sum = sum And &HFF
|
||||
Next
|
||||
Dim sumMod As Byte = &HFF - sum
|
||||
Return sumMod
|
||||
End Function
|
||||
''' <summary>
|
||||
''' 校验网络数据
|
||||
''' </summary>
|
||||
''' <param name="data_content"></param>
|
||||
''' <param name="Type_Param"></param>
|
||||
''' <param name="state"></param>
|
||||
Public Shared Sub Check_Network_Data(data_content As Byte(), ByRef Type_Param As List(Of String), state As Boolean)
|
||||
Dim data As Byte() = data_content.Skip(8).ToArray
|
||||
Dim _head() As Byte = {&HAA, &H55}
|
||||
Dim head() As Byte
|
||||
Dim crc As Byte()
|
||||
Dim crc16 As Byte() = New Byte() {0, 0}
|
||||
Dim Len As Integer
|
||||
Dim length As Integer
|
||||
Dim l As Integer = data.Length - 2
|
||||
crc = data.Skip(l).Take(2).ToArray()
|
||||
Dim crcdata As Byte() = data.Take(l).ToArray
|
||||
crc16 = GetCRC16CheckSum(crcdata, crcdata.Length)
|
||||
head = data.Skip(0).Take(2).ToArray()
|
||||
Len = data(3) * 256 + data(2)
|
||||
length = data.Length
|
||||
Dim id As String = Encoding.ASCII.GetString(data.Skip(4).Take(4).ToArray)
|
||||
If head(0) = _head(0) And head(1) = _head(1) Then '包头校验
|
||||
If Len = length Then '和校验
|
||||
If id = "T3SA" Then
|
||||
If crc16(0) = crc(0) And crc16(1) = crc(1) Then 'crc校验
|
||||
Dim ntwdata As New NetworkData
|
||||
ntwdata.Parsing_Network_Data(data, Type_Param, state)
|
||||
Else
|
||||
Console.WriteLine("CRC校验失败")
|
||||
End If
|
||||
Else
|
||||
Console.WriteLine("固定ID校验失败")
|
||||
End If
|
||||
Else
|
||||
Console.WriteLine("长度校验失败")
|
||||
End If
|
||||
Else
|
||||
Console.WriteLine("包头校验失败")
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
Public Shared Function GetLen(i As Integer) As Byte()
|
||||
Dim len(1) As Byte
|
||||
len(1) = i \ 256
|
||||
len(0) = i Mod 256
|
||||
Return len
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' CRC16校验
|
||||
''' </summary>
|
||||
''' <param name="dataBuff"></param>
|
||||
''' <param name="length"></param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function GetCRC16CheckSum(dataBuff() As Byte, length As Integer) As Byte()
|
||||
Dim crc16 As UInteger
|
||||
Dim crcBytes() As Byte
|
||||
|
||||
crc16 = &HFFFF
|
||||
For i = 0 To length - 1
|
||||
crc16 = crc16 And &HFFFF
|
||||
crc16 = crc16 Xor dataBuff(i)
|
||||
For bit = 0 To 7
|
||||
crc16 = IIf((crc16 And 1) = 0, crc16 >> 1, (crc16 >> 1) Xor &HA001)
|
||||
Next
|
||||
Next
|
||||
crc16 = crc16 And &HFFFF
|
||||
crcBytes = BitConverter.GetBytes(UShort.Parse(crc16))
|
||||
Return crcBytes
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' byte()转integer
|
||||
''' </summary>
|
||||
''' <param name="i"></param>
|
||||
''' <returns></returns>
|
||||
Public Shared Function ByteToInt(i As Byte()) As Integer
|
||||
If i.Count() = 1 Then
|
||||
Return i(0)
|
||||
End If
|
||||
If i.Count() = 2 Then
|
||||
Dim a As Integer = i(0)
|
||||
Dim b As Integer = i(1)
|
||||
Return ((a << 8) And &HFF00) Xor (b And &HFF)
|
||||
End If
|
||||
If i.Count() = 4 Then
|
||||
Dim a As Integer = i(0)
|
||||
Dim b As Integer = i(1)
|
||||
Dim c As Integer = i(2)
|
||||
Dim d As Integer = i(3)
|
||||
Return ((a And &HFF) << 24) Xor ((b And &HFF) << 16) Xor ((c And &HFF) << 8) Xor (d And &HFF)
|
||||
End If
|
||||
Return 0
|
||||
End Function
|
||||
|
||||
End Class
|
||||
15
Database/Base/ColumnSchema.vb
Normal file
15
Database/Base/ColumnSchema.vb
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
Namespace Database.Base
|
||||
''' <summary>
|
||||
''' Contains the schema of a single DB column.
|
||||
''' </summary>
|
||||
Public Class ColumnSchema
|
||||
Public ColumnName As String
|
||||
Public ColumnType As String
|
||||
Public Length As Integer
|
||||
Public IsNullable As Boolean
|
||||
Public DefaultValue As String
|
||||
Public IsIdentity As Boolean
|
||||
Public IsCaseSensitivity As Boolean? = Nothing
|
||||
End Class
|
||||
End NameSpace
|
||||
297
Database/Base/CommandHelpers.vb
Normal file
297
Database/Base/CommandHelpers.vb
Normal file
@@ -0,0 +1,297 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Base
|
||||
|
||||
Public MustInherit Class CommandHelpers
|
||||
Public Overridable Function Search(param As SearchParams) As String
|
||||
Dim searchString As New StringBuilder
|
||||
|
||||
'基础查询
|
||||
searchString.Append("Select")
|
||||
searchString.Append(" ")
|
||||
searchString.Append($"{String.Join(",", param.SearchColNames)}")
|
||||
searchString.Append(" ")
|
||||
searchString.Append("From")
|
||||
searchString.Append(" ")
|
||||
searchString.Append($"`{param.TableName}`")
|
||||
|
||||
'筛选条件
|
||||
If param.SearchCondition IsNot Nothing Then
|
||||
If param.SearchCondition.Count > 0 Then
|
||||
searchString.Append(" ")
|
||||
searchString.Append("Where")
|
||||
For i As Integer = 0 To param.SearchCondition.Count - 1
|
||||
If i > 0 Then
|
||||
searchString.Append(" ")
|
||||
searchString.Append(param.SearchCondition(i).LogicPrevious.ToString())
|
||||
End If
|
||||
searchString.Append(param.SearchCondition(i).ToString())
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
|
||||
'排序与排序方式
|
||||
If param.OrderType <> SearchParams.OrderTypeEnum.None Then
|
||||
searchString.Append($" Order By {param.OrderColName} {param.OrderType}")
|
||||
End If
|
||||
|
||||
'返回结果行数
|
||||
If param.Limit > -1 Then
|
||||
searchString.Append($" Limit {param.Limit}")
|
||||
End If
|
||||
|
||||
searchString.Append(";")
|
||||
Return searchString.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function SearchAll(tableName As String) As String
|
||||
Return $"Select * FROM `{tableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchAll(tableName As String, condition As String) As String
|
||||
Return $"Select * FROM `{tableName}` WHERE {condition};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Search(columnName As List(Of String), tableName As String) As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"`{columnName(i)}`")
|
||||
Else
|
||||
colNameString.Append($",`{columnName(i)}`")
|
||||
End If
|
||||
Next
|
||||
|
||||
Return $"Select {colNameString} FROM `{tableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Search(columnName As String, tableName As String) As String
|
||||
Return $"Select {columnName} FROM `{tableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Search(columnName As String, tableName As String, condition As String) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` WHERE {condition};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Search(columnName As String, tableName As String, condition As String, limit As Integer) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` WHERE {condition} Limit {limit};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchDistinct(columnName As String, tableName As String) As String
|
||||
Return $"Select Distinct {columnName} FROM `{tableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchDistinct(columnName As String, tableName As String, condition As String) As String
|
||||
Return $"Select Distinct {columnName} FROM `{tableName}` WHERE {condition};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchDescOrder(columnName As String, tableName As String, orderCol As String) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` Order By {orderCol} Desc;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchDescOrder(columnName As String, tableName As String, orderCol As String, limit As Integer) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` Order By {orderCol} Desc Limit {limit};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchDescOrder(columnName As String, ByVal tableName As String, ByVal condition As String, ByVal orderCol As String) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` WHERE {condition} Order By `{orderCol}` Desc;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchDescOrder(columnName As String, ByVal tableName As String, ByVal condition As String, ByVal orderCol As String, limit As Integer) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` WHERE {condition} Order By `{orderCol}` Desc Limit {limit};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchAscOrder(ByVal columnName As String, ByVal tableName As String, ByVal orderCol As String) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` Order By {orderCol} Asc;"
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function SearchAscOrder(ByVal columnName As String, ByVal tableName As String, ByVal condition As String, ByVal orderCol As String) As String
|
||||
Return $"Select {columnName} FROM `{tableName}` WHERE {condition} Order By {orderCol} Asc;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchNullTable(tableName As String) As String
|
||||
Return $"Select * FROM `{tableName}` Where Limit 0;"
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function Insert(ByVal tableName As String, ByVal values As String) As String
|
||||
Return $"Insert into `{tableName}` Values ( {values} );"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Insert(ByVal tableName As String, ByVal colNames As String, ByVal values As String) As String
|
||||
Return $"Insert into `{tableName}` ({colNames}) Values ( {values} );"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Insert(tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"`{keyValuePair.Key}`")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",`{keyValuePair.Key}`")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
Public Overridable Function InsertByParameters(tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"`{keyValuePair.Key}`")
|
||||
values.Append($"{keyValuePair.Value}")
|
||||
Else
|
||||
colNames.Append($",`{keyValuePair.Key}`")
|
||||
values.Append($",{keyValuePair.Value}")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function AddCol(ByVal tableName As String, ByVal colName As String, ByVal colType As String, Optional isNull As Boolean = True) As String
|
||||
Return $"Alter Table `{tableName}` Add `{colName}` {colType} {IIf(isNull, "Default Null", "Not Null")};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function AddCol(ByVal tableName As String, colParam As DatabaseData) As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"Alter Table `{tableName}` ")
|
||||
sb.Append("Add ")
|
||||
sb.Append(colParam.ToAddColString())
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function AddCols(tableName As String, colList As List(Of DatabaseData)) As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"Alter Table `{tableName}` ")
|
||||
sb.Append("Add ")
|
||||
sb.Append("( ")
|
||||
|
||||
sb.Append(colList(0).ToAddColString())
|
||||
For i As Integer = 1 To colList.Count - 1
|
||||
sb.Append($",{colList(i).ToAddColString()}")
|
||||
Next
|
||||
|
||||
sb.Append(");")
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function Update(ByVal tableName As String, ByVal destStr As String, ByVal condition As String) As String
|
||||
Return $"Update `{tableName}` Set {destStr} Where {condition};"
|
||||
End Function
|
||||
|
||||
Public Overridable Function Update(ByVal tableName As String, dicNameValues As Dictionary(Of String, String), ByVal condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"`{keyValuePair.Key}` = '{keyValuePair.Value}'")
|
||||
Else
|
||||
destStr.Append($",`{keyValuePair.Key}` = '{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return Update(tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
Public Overridable Function Update(ByVal tableName As String, names() As String, values() As String, condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
If names.Length <> values.Length Then
|
||||
Throw New Exception("DBHelpers_Update:names.Length <> values.Length")
|
||||
End If
|
||||
|
||||
For i As Integer = 0 To names.Length - 1
|
||||
If i = 0 Then
|
||||
destStr.Append($"{names(i)} = '{values(i)}'")
|
||||
Else
|
||||
destStr.Append($",{names(i)} = '{values(i)}'")
|
||||
End If
|
||||
Next
|
||||
|
||||
Return Update(tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
Public Overridable Function DeleteRows(ByVal tableName As String, ByVal condition As String) As String
|
||||
Return $"Delete From `{tableName}` Where {condition};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DeleteTable(ByVal tableName As String) As String
|
||||
Return $"Delete From `{tableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function DropCol(ByVal tableName As String, ByVal colName As String) As String
|
||||
Return $"Alter Table `{tableName}` Drop Column `{colName}`;"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 删除数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropTable(ByVal tableName As String) As String
|
||||
Return $"Drop Table `{tableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function CreateTable(ByVal tableName As String, ByVal createStr As String) As String
|
||||
Return $"Create Table `{tableName}` ( {createStr} );"
|
||||
End Function
|
||||
|
||||
Public Overridable Function CreateTableWhenNotExists(tableName As String, createStr As String) As String
|
||||
Return $"Create Table if not exists `{tableName}` ( {createStr} );"
|
||||
End Function
|
||||
|
||||
|
||||
Public Overridable Function CreateLikeTable(tableName As String, baseTableName As String) As String
|
||||
Return $"create table `{tableName}` like `{baseTableName}`;"
|
||||
End Function
|
||||
|
||||
Public Overridable Function CreateLikeTableNotExists(tableName As String, baseTableName As String) As String
|
||||
Return $"create table if not exists `{tableName}` like `{baseTableName}`;"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 创建表,同时复制基础表数据(不包含原表索引与主键)
|
||||
''' 若想复制表结构加数据,则先复制表结构创建表,再拷贝数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="baseTableName">基础表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function CreateCopyTable(tableName As String, baseTableName As String) As String
|
||||
Return $"create table `{tableName}` as select * from `{baseTableName}`;"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 不存在表时即创建表,同时复制基础表数据(不包含原表索引与主键)
|
||||
''' 若想复制表结构加数据,则先复制表结构创建表,再拷贝数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="baseTableName">基础表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function CreateCopyTableNotExists(tableName As String, baseTableName As String) As String
|
||||
Return $"create table if not exists `{tableName}` as select * from `{baseTableName}`;"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 复制基础表数据到新表中
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="baseTableName">基础表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function InsertCopyTable(tableName As String, baseTableName As String) As String
|
||||
Return $"insert into `{tableName}` select * from `{baseTableName}`;"
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
94
Database/Base/DatabaseData.vb
Normal file
94
Database/Base/DatabaseData.vb
Normal file
@@ -0,0 +1,94 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Base
|
||||
Public Class DatabaseData
|
||||
Enum TypeEnum
|
||||
[Bit]
|
||||
[Char]
|
||||
[Date]
|
||||
[DateTime]
|
||||
[Double]
|
||||
[Enum]
|
||||
[Float]
|
||||
[Int]
|
||||
[IntUnsigned]
|
||||
[Json]
|
||||
[Text]
|
||||
[Time]
|
||||
Varchar
|
||||
[Year]
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As TypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case TypeEnum.Char, TypeEnum.Varchar
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case TypeEnum.Int
|
||||
sb.Append($" {DataType}")
|
||||
If IsAutoIncrement Then sb.Append($" AUTO_INCREMENT")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
12
Database/Base/DatabaseSchema.vb
Normal file
12
Database/Base/DatabaseSchema.vb
Normal file
@@ -0,0 +1,12 @@
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Namespace Database.Base
|
||||
|
||||
''' <summary>
|
||||
''' Contains the entire database schema
|
||||
''' </summary>
|
||||
Public Class DatabaseSchema
|
||||
Public Tables As List(Of TableSchema) = New List(Of TableSchema)()
|
||||
Public Views As List(Of ViewSchema) = New List(Of ViewSchema)()
|
||||
End Class
|
||||
End NameSpace
|
||||
11
Database/Base/ForeignKeySchema.vb
Normal file
11
Database/Base/ForeignKeySchema.vb
Normal file
@@ -0,0 +1,11 @@
|
||||
|
||||
Namespace Database.Base
|
||||
Public Class ForeignKeySchema
|
||||
Public TableName As String
|
||||
Public ColumnName As String
|
||||
Public ForeignTableName As String
|
||||
Public ForeignColumnName As String
|
||||
Public CascadeOnDelete As Boolean
|
||||
Public IsNullable As Boolean
|
||||
End Class
|
||||
End NameSpace
|
||||
16
Database/Base/IndexSchema.vb
Normal file
16
Database/Base/IndexSchema.vb
Normal file
@@ -0,0 +1,16 @@
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Namespace Database.Base
|
||||
|
||||
|
||||
Public Class IndexSchema
|
||||
Public IndexName As String
|
||||
Public IsUnique As Boolean
|
||||
Public Columns As List(Of IndexColumn)
|
||||
End Class
|
||||
|
||||
Public Class IndexColumn
|
||||
Public ColumnName As String
|
||||
Public IsAscending As Boolean
|
||||
End Class
|
||||
End NameSpace
|
||||
7
Database/Base/InsertParams.vb
Normal file
7
Database/Base/InsertParams.vb
Normal file
@@ -0,0 +1,7 @@
|
||||
Namespace Database.Base
|
||||
Public Class InsertParams
|
||||
Public Property TableName() As String
|
||||
|
||||
Public Property InsertKeyValue As Dictionary(Of String, String)
|
||||
End Class
|
||||
End Namespace
|
||||
71
Database/Base/SearchCondition.vb
Normal file
71
Database/Base/SearchCondition.vb
Normal file
@@ -0,0 +1,71 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Base
|
||||
Public Class SearchCondition
|
||||
Enum ConditionType
|
||||
LessThan
|
||||
GreaterThen
|
||||
EqualTo
|
||||
LessThanOrEqualTo
|
||||
GreaterThenOrEqualTo
|
||||
End Enum
|
||||
|
||||
Enum LogicType
|
||||
[And]
|
||||
[Or]
|
||||
[Not]
|
||||
End Enum
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 判断列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 判断条件
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Condition() As ConditionType = ConditionType.EqualTo
|
||||
|
||||
''' <summary>
|
||||
''' 判断值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前条件与上一个条件的逻辑关系
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property LogicPrevious() As LogicType = LogicType.And
|
||||
|
||||
''' <summary>
|
||||
''' 将当前条件转换为字符串,不支持将条件逻辑关系同时转换
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Overrides Function ToString() As String
|
||||
Dim stringBuilder As New StringBuilder
|
||||
stringBuilder.Append(" ")
|
||||
stringBuilder.Append(ColName)
|
||||
|
||||
Select Case Condition
|
||||
Case ConditionType.EqualTo
|
||||
stringBuilder.Append("=")
|
||||
Case ConditionType.LessThan
|
||||
stringBuilder.Append("<")
|
||||
Case ConditionType.LessThanOrEqualTo
|
||||
stringBuilder.Append("<=")
|
||||
Case ConditionType.GreaterThen
|
||||
stringBuilder.Append(">")
|
||||
Case ConditionType.GreaterThenOrEqualTo
|
||||
stringBuilder.Append(">=")
|
||||
End Select
|
||||
|
||||
stringBuilder.Append($"'{ColValue}'")
|
||||
|
||||
Return stringBuilder.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
46
Database/Base/SearchParams.vb
Normal file
46
Database/Base/SearchParams.vb
Normal file
@@ -0,0 +1,46 @@
|
||||
Namespace Database.Base
|
||||
Public Class SearchParams
|
||||
Enum OrderTypeEnum
|
||||
None
|
||||
Desc
|
||||
Asc
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 查询条件的表名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property TableName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当IsSearchAllCols = False时,查询返回列名集合
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property SearchColNames() As String()
|
||||
|
||||
''' <summary>
|
||||
''' 查询的条件
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property SearchCondition() As List(Of SearchCondition)
|
||||
|
||||
''' <summary>
|
||||
''' 排序方式
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property OrderType As OrderTypeEnum = OrderTypeEnum.None
|
||||
|
||||
''' <summary>
|
||||
''' 但需要排序时排序列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property OrderColName() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 从返回结果提取指定行的内容
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Limit() As Integer = 0
|
||||
End Class
|
||||
End Namespace
|
||||
14
Database/Base/TableSchema.vb
Normal file
14
Database/Base/TableSchema.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Imports System.Collections.Generic
|
||||
|
||||
Namespace Database.Base
|
||||
|
||||
|
||||
Public Class TableSchema
|
||||
Public TableName As String
|
||||
Public TableSchemaName As String
|
||||
Public Columns As List(Of ColumnSchema)
|
||||
Public PrimaryKey As List(Of String)
|
||||
Public ForeignKeys As List(Of ForeignKeySchema)
|
||||
Public Indexes As List(Of IndexSchema)
|
||||
End Class
|
||||
End NameSpace
|
||||
71
Database/Base/TriggerBuilder.vb
Normal file
71
Database/Base/TriggerBuilder.vb
Normal file
@@ -0,0 +1,71 @@
|
||||
Imports System.Collections.Generic
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Base
|
||||
|
||||
Public Module TriggerBuilder
|
||||
Public Function GetForeignKeyTriggers(ByVal dt As TableSchema) As IList(Of TriggerSchema)
|
||||
Dim result As IList(Of TriggerSchema) = New List(Of TriggerSchema)()
|
||||
For Each fks As ForeignKeySchema In dt.ForeignKeys
|
||||
result.Add(GenerateInsertTrigger(fks))
|
||||
result.Add(GenerateUpdateTrigger(fks))
|
||||
result.Add(GenerateDeleteTrigger(fks))
|
||||
Next
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Private Function MakeTriggerName(ByVal fks As ForeignKeySchema, ByVal prefix As String) As String
|
||||
Return prefix & "_" & fks.TableName & "_" & fks.ColumnName & "_" & fks.ForeignTableName & "_" & fks.ForeignColumnName
|
||||
End Function
|
||||
|
||||
Public Function GenerateInsertTrigger(ByVal fks As ForeignKeySchema) As TriggerSchema
|
||||
Dim trigger As TriggerSchema = New TriggerSchema()
|
||||
trigger.Name = MakeTriggerName(fks, "fki")
|
||||
trigger.Type = TriggerType.Before
|
||||
trigger.Event = TriggerEvent.Insert
|
||||
trigger.Table = fks.TableName
|
||||
Dim nullString As String = ""
|
||||
|
||||
If fks.IsNullable Then
|
||||
nullString = " NEW." & fks.ColumnName & " IS NOT NULL AND"
|
||||
End If
|
||||
|
||||
trigger.Body = "SELECT RAISE(ROLLBACK, 'insert on table " & fks.TableName & " violates foreign key constraint " & trigger.Name & "')" & " WHERE" & nullString & " (SELECT " & fks.ForeignColumnName & " FROM " & fks.ForeignTableName & " WHERE " & fks.ForeignColumnName & " = NEW." & fks.ColumnName & ") IS NULL; "
|
||||
Return trigger
|
||||
End Function
|
||||
|
||||
Public Function GenerateUpdateTrigger(ByVal fks As ForeignKeySchema) As TriggerSchema
|
||||
Dim trigger As TriggerSchema = New TriggerSchema()
|
||||
trigger.Name = MakeTriggerName(fks, "fku")
|
||||
trigger.Type = TriggerType.Before
|
||||
trigger.Event = TriggerEvent.Update
|
||||
trigger.Table = fks.TableName
|
||||
Dim triggerName As String = trigger.Name
|
||||
Dim nullString As String = ""
|
||||
|
||||
If fks.IsNullable Then
|
||||
nullString = " NEW." & fks.ColumnName & " IS NOT NULL AND"
|
||||
End If
|
||||
|
||||
trigger.Body = "SELECT RAISE(ROLLBACK, 'update on table " & fks.TableName & " violates foreign key constraint " & triggerName & "')" & " WHERE" & nullString & " (SELECT " & fks.ForeignColumnName & " FROM " & fks.ForeignTableName & " WHERE " & fks.ForeignColumnName & " = NEW." & fks.ColumnName & ") IS NULL; "
|
||||
Return trigger
|
||||
End Function
|
||||
|
||||
Public Function GenerateDeleteTrigger(ByVal fks As ForeignKeySchema) As TriggerSchema
|
||||
Dim trigger As TriggerSchema = New TriggerSchema()
|
||||
trigger.Name = MakeTriggerName(fks, "fkd")
|
||||
trigger.Type = TriggerType.Before
|
||||
trigger.Event = TriggerEvent.Delete
|
||||
trigger.Table = fks.ForeignTableName
|
||||
Dim triggerName as String = trigger.Name
|
||||
|
||||
If Not fks.CascadeOnDelete Then
|
||||
trigger.Body = "SELECT RAISE(ROLLBACK, 'delete on table " & fks.ForeignTableName & " violates foreign key constraint " & triggerName & "')" & " WHERE (SELECT " & fks.ColumnName & " FROM " & fks.TableName & " WHERE " & fks.ColumnName & " = OLD." & fks.ForeignColumnName & ") IS NOT NULL; "
|
||||
Else
|
||||
trigger.Body = "DELETE FROM [" & fks.TableName & "] WHERE " & fks.ColumnName & " = OLD." & fks.ForeignColumnName & "; "
|
||||
End If
|
||||
|
||||
Return trigger
|
||||
End Function
|
||||
End Module
|
||||
End NameSpace
|
||||
20
Database/Base/TriggerSchema.vb
Normal file
20
Database/Base/TriggerSchema.vb
Normal file
@@ -0,0 +1,20 @@
|
||||
Namespace Database.Base
|
||||
Public Enum TriggerEvent
|
||||
Delete
|
||||
Update
|
||||
Insert
|
||||
End Enum
|
||||
|
||||
Public Enum TriggerType
|
||||
After
|
||||
Before
|
||||
End Enum
|
||||
|
||||
Public Class TriggerSchema
|
||||
Public Name As String
|
||||
Public [Event] As TriggerEvent
|
||||
Public Type As TriggerType
|
||||
Public Body As String
|
||||
Public Table As String
|
||||
End Class
|
||||
End Namespace
|
||||
17
Database/Base/ViewSchema.vb
Normal file
17
Database/Base/ViewSchema.vb
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
Namespace Database.Base
|
||||
''' <summary>
|
||||
''' Describes a single view schema
|
||||
''' </summary>
|
||||
Public Class ViewSchema
|
||||
''' <summary>
|
||||
''' Contains the view name
|
||||
''' </summary>
|
||||
Public ViewName As String
|
||||
|
||||
''' <summary>
|
||||
''' Contains the view SQL statement
|
||||
''' </summary>
|
||||
Public ViewSql As String
|
||||
End Class
|
||||
End NameSpace
|
||||
747
Database/DbCmdHelper.vb
Normal file
747
Database/DbCmdHelper.vb
Normal file
@@ -0,0 +1,747 @@
|
||||
Imports System.Text
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据库语句助手
|
||||
''' 时间:2020-12-21
|
||||
''' 作者:ML
|
||||
''' 版本:1.0
|
||||
'''
|
||||
''' 注意:添加一条数据库帮助语句时,需要考虑Mysql/Sqlite/Mssql等数据库是否支持命令,不支持则需要在对应帮助类中重写该帮助语句
|
||||
''' 注意:Sqlite数据库与大多数据库不相同,DB开头数据库语句大多不适用
|
||||
'''
|
||||
''' </summary>
|
||||
Public MustInherit Class DbCmdHelper
|
||||
Protected FiledSuffix As Char
|
||||
Protected FiledPrefix As Char
|
||||
|
||||
Public Shared Function CreateCmdHelper(type As DbExecutor.DbTypeEnum) As DbCmdHelper
|
||||
Select Case type
|
||||
Case DbExecutor.DbTypeEnum.Mysql
|
||||
Return New MysqlCmdHelper()
|
||||
Case DbExecutor.DbTypeEnum.Mssql
|
||||
Return New MssqlCmdHelper()
|
||||
Case DbExecutor.DbTypeEnum.Sqlite
|
||||
Return New SqliteCmdHelper()
|
||||
Case Else
|
||||
Throw New Exception($"CreateCmdHelper :Unknown Type {type}")
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
#Region "访问单数据库连接"
|
||||
''' <summary>
|
||||
''' 查询指定数据表符合条件的所有数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="condition">查询条件,</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchAll(tableName As String, Optional condition As String = "") As String
|
||||
If String.IsNullOrWhiteSpace(condition) Then
|
||||
Return $"Select * FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select * FROM {FiledSuffix}{tableName}{FiledPrefix} WHERE {condition};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="columnName">列名集合,需要返回多列时用','符号分隔列名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Search(columnName As String, tableName As String, Optional condition As String = "") As String
|
||||
If String.IsNullOrWhiteSpace(condition) Then
|
||||
Return $"Select {columnName} FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select {columnName} FROM {FiledSuffix}{tableName}{FiledPrefix} WHERE {condition};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="columnName">表名</param>
|
||||
''' <param name="tableName">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Search(columnName As List(Of String), tableName As String, Optional condition As String = "") As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
End If
|
||||
Next
|
||||
|
||||
If String.IsNullOrWhiteSpace(condition) Then
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix} Where {condition};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchOrder(columnName As List(Of String), tableName As String, Optional orderString As String = "") As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
End If
|
||||
Next
|
||||
|
||||
If String.IsNullOrWhiteSpace(orderString) Then
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix} {orderString};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定表包含的内容行数
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <param name="condition">查询条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchCount(tableName As String, Optional condition As String = "") As String
|
||||
Return Search("count(*)", tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchTableInfo(tableName As String) As String
|
||||
Return $"Select * from information_schema.tables where table_name = '{tableName}';"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表是否存在的信息,返回查询当前表在数据库中存在的数量
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchTableExists(tableName As String) As String
|
||||
Return $"Select count(*) from information_schema.tables where table_name = '{tableName}';"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colNames">列名字符串</param>
|
||||
''' <param name="values">列值字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Insert(tableName As String, colNames As String, values As String) As String
|
||||
Return $"Insert into {FiledSuffix}{tableName}{FiledPrefix} ({colNames}) Values ( {values} );"
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="dicNameValues">列名与列值键值对</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Insert(tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
Public Overridable Function Insert2(tableName As String, dicNameValues As Dictionary(Of String, Object )) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, Object) In dicNameValues
|
||||
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行,通过命令参数方式执行时使用
|
||||
''' </summary>
|
||||
''' <param name="tableName"></param>
|
||||
''' <param name="dicNameValues"></param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function InsertParam(tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"{keyValuePair.Value}")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",{keyValuePair.Value}")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行,通过命令参数方式执行时使用,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colNames">字段列表</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function InsertParam(tableName As String, colNames As List(Of String)) As String
|
||||
Dim colNameString As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If colNameString.Length = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{colName}{FiledPrefix}")
|
||||
values.Append($"@{colName}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{colName}{FiledPrefix}")
|
||||
values.Append($",@{colName}")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNameString.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定表数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="destStr">更新字符串</param>
|
||||
''' <param name="condition"></param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Update(tableName As String, destStr As String, condition As String) As String
|
||||
Return $"Update {FiledSuffix}{tableName}{FiledPrefix} Set {destStr} Where {condition};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定表数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="dicNameValues">更新列名与列值键值对</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Update(tableName As String, dicNameValues As Dictionary(Of String, String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix} = '{keyValuePair.Value}'")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix} = '{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return Update(tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="colNames">更新列名的集合</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function UpdateParam(tableName As String, colNames As List(Of String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
End If
|
||||
Next
|
||||
Return Update(tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据表增加一列数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">列名</param>
|
||||
''' <param name="colType">列类型</param>
|
||||
''' <param name="isNull">是否允许为空</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function AddCol(tableName As String, colName As String, colType As String, Optional isNull As Boolean = True) As String
|
||||
Return $"Alter Table {FiledSuffix}{tableName}{FiledPrefix} Add {FiledSuffix}{colName}{FiledPrefix} {colType} {IIf(isNull, "Default Null", "Not Null")};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据表删除一列数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">需要删除的列名,仅一列</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropCol(tableName As String, colName As String) As String
|
||||
Return $"Alter Table {FiledSuffix}{tableName}{FiledPrefix} Drop Column {FiledSuffix}{colName}{FiledPrefix};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 删除指定表多行数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DeleteRows(tableName As String, condition As String) As String
|
||||
Return $"Delete From {FiledSuffix}{tableName}{FiledPrefix} Where {condition};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 创建数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function CreateTable(tableName As String, createStr As String) As String
|
||||
Return $"Create Table {FiledSuffix}{tableName}{FiledPrefix} ( {createStr} );"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 创建数据表,如果存在则不创建
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function CreateTableWhenNotExists(tableName As String, createStr As String) As String
|
||||
Return $"Create Table if not exists {FiledSuffix}{tableName}{FiledPrefix} ( {createStr} );"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空数据表,表依旧存在
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DeleteTable(tableName As String) As String
|
||||
Return $"Delete From {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 删除数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropTable(tableName As String) As String
|
||||
Return $"Drop Table {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 删除数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropTableWhenExists(tableName As String) As String
|
||||
Return $"Drop Table If Exists {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "访问多数据库连接"
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="ColsName">列名集合,需要返回多列时用','符号分隔列名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearch(dbName As String, colsName As String, tableName As String, Optional condition As String = "") As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Select {colsName} From ")
|
||||
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
|
||||
If String.IsNullOrWhiteSpace(condition) = False Then
|
||||
cmdText.Append($" WHERE {condition}")
|
||||
End If
|
||||
|
||||
cmdText.Append($";")
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有指定列的去重数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="ColsName">列名集合,需要返回多列时用','符号分隔列名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDistinctSearch(dbName As String, colsName As String, tableName As String, Optional condition As String = "") As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Select Distinct {colsName} From ")
|
||||
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
|
||||
If String.IsNullOrWhiteSpace(condition) = False Then
|
||||
cmdText.Append($" WHERE {condition}")
|
||||
End If
|
||||
|
||||
cmdText.Append($";")
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="columnName">表名</param>
|
||||
''' <param name="tableName">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearch(dbName As String, columnName As List(Of String), tableName As String, Optional condition As String = "") As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
End If
|
||||
Next
|
||||
|
||||
Return DbSearch(dbName, colNameString.ToString(), tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定表包含的内容行数
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <param name="condition">查询条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchCount(dbName As String, tableName As String, Optional condition As String = "") As String
|
||||
Return DbSearch(dbName, "count(*)", tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有数据
|
||||
'''
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <param name="condition">查询条件(可选)</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchAll(dbName As String, tableName As String, Optional condition As String = "") As String
|
||||
Return DbSearch(dbName, "*", tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchTableInfo(dbName As String, tableName As String) As String
|
||||
Return DbSearch("", "*", "information_schema.tables", "table_schema = '{dbName}' and table_name = '{tableName}'")
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表是否存在的信息,返回查询当前表在指定数据库中存在的数量
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchTableExists(dbName As String, tableName As String) As String
|
||||
Return DbSearch("", "count(*)", "information_schema.tables", "table_schema = '{dbName}' and table_name = '{tableName}'")
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colNames">列名字符串</param>
|
||||
''' <param name="values">列值字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbInsert(dbName As String, tableName As String, colNames As String, values As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Insert into ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" ({colNames}) Values ( {values} );")
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="dicNameValues">列名与列值键值对</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbInsert(dbName As String, tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
|
||||
Return DbInsert(dbName, tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表插入一行,通过命令参数方式执行时使用,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName"></param>
|
||||
''' <param name="colNames">需要插入列名的集合</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbInsertParam(dbName As String, tableName As String, colNames As List(Of String)) As String
|
||||
Dim colNameBuilder As New StringBuilder
|
||||
Dim valueBuilder As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If colNameBuilder.Length = 0 Then
|
||||
colNameBuilder.Append($"{FiledSuffix}{colName}{FiledPrefix}")
|
||||
valueBuilder.Append($"@{colName}")
|
||||
Else
|
||||
colNameBuilder.Append($",{FiledSuffix}{colName}{FiledPrefix}")
|
||||
valueBuilder.Append($",@{colName}")
|
||||
End If
|
||||
Next
|
||||
'insert into dbName.tablename (1,2,3) value (@1,@2,@3)
|
||||
Return DbInsert(dbName, tableName, colNameBuilder.ToString(), valueBuilder.ToString())
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="destStr">更新字符串</param>
|
||||
''' <param name="condition"></param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbUpdate(dbName As String, tableName As String, destStr As String, condition As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
Dim tmpStrCmdText As String = ""
|
||||
|
||||
cmdText.Append($"Update ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Set {destStr} Where {condition};")
|
||||
tmpStrCmdText = cmdText.ToString()
|
||||
Console.WriteLine("SQL_CMD = " & tmpStrCmdText)
|
||||
|
||||
Return tmpStrCmdText
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="colNames">更新列名的集合</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbUpdateParam(dbName As String, tableName As String, colNames As List(Of String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
End If
|
||||
Next
|
||||
Return DbUpdate(dbName, tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="filedDictionary">更新列名与列值键值对</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbUpdate(dbName As String, tableName As String, filedDictionary As Dictionary(Of String, String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each filed As KeyValuePair(Of String, String) In filedDictionary
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{filed.Key}{FiledPrefix} = '{filed.Value}'")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{filed.Key}{FiledPrefix} = '{filed.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return DbUpdate(dbName, tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中指定数据表增加一列数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">列名</param>
|
||||
''' <param name="colType">列类型</param>
|
||||
''' <param name="isNull">是否允许为空</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbAddCol(dbName As String, tableName As String, colName As String, colType As String, Optional isNull As Boolean = True) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Alter Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Add {FiledSuffix}{colName}{FiledPrefix} {colType} {IIf(isNull, "Default Null", "Not Null")};")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表删除一列数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">需要删除的列名,仅一列</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDropCol(dbName As String, tableName As String, colName As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Alter Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Drop Column {FiledSuffix}{colName}{FiledPrefix};")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中指定表删除多行数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDeleteRows(dbName As String, tableName As String, condition As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Delete From ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Where {condition};")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中创建数据表
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbCreateTable(dbName As String, tableName As String, createStr As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Create Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" ( {createStr} );")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中创建数据表,如果存在则不创建
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbCreateTableWhenNotExists(dbName As String, tableName As String, createStr As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Create Table if not exists ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" ( {createStr} );")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空指定数据库中数据表,表依旧存在
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDeleteTable(dbName As String, tableName As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Delete From ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($";")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 删除指定数据库中数据表
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDropTable(dbName As String, tableName As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Drop Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($";")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
#End Region
|
||||
End Class
|
||||
377
Database/DbExecutor.vb
Normal file
377
Database/DbExecutor.vb
Normal file
@@ -0,0 +1,377 @@
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SQLite
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
''' <summary>
|
||||
''' 数据库通用命令执行器
|
||||
''' 时间:2020-12-21
|
||||
''' 作者:ML
|
||||
''' 版本:1.0
|
||||
''' </summary>
|
||||
Public Class DbExecutor
|
||||
Implements IDisposable
|
||||
''' <summary>
|
||||
''' 数据库类型,目前支持Mysql与Sqlite
|
||||
''' </summary>
|
||||
Enum DbTypeEnum
|
||||
Mysql
|
||||
Sqlite
|
||||
Mssql
|
||||
End Enum
|
||||
|
||||
|
||||
Private ReadOnly _connectionString As String '数据库连接语句
|
||||
|
||||
Private ReadOnly _dbType As DbTypeEnum '数据库类型
|
||||
|
||||
Private _connection As DbConnection '数据库连接句柄
|
||||
|
||||
Private _command As DbCommand '数据库命令句柄
|
||||
|
||||
Private _dataAdapter As DbDataAdapter '数据库查询填充器句柄
|
||||
|
||||
Private _transaction As DbTransaction '数据库事务句柄
|
||||
|
||||
Private _commandHelper As DbCmdHelper '数据库语句填充助手
|
||||
|
||||
Sub New(type As DbTypeEnum, connectionString As String)
|
||||
_dbType = type
|
||||
_connectionString = connectionString
|
||||
InitByDbType(_dbType)
|
||||
End Sub
|
||||
|
||||
Private Sub InitByDbType(type As DbTypeEnum)
|
||||
Select Case type
|
||||
Case DbTypeEnum.Mysql
|
||||
_connection = New MySqlConnection()
|
||||
_command = _connection.CreateCommand()
|
||||
_dataAdapter = New MySqlDataAdapter() With {.MissingSchemaAction = MissingSchemaAction.AddWithKey}
|
||||
|
||||
_commandHelper = New MysqlCmdHelper()
|
||||
Case DbTypeEnum.Sqlite
|
||||
_connection = New SqliteConnection()
|
||||
_command = _connection.CreateCommand()
|
||||
_dataAdapter = New SQLiteDataAdapter() With {.MissingSchemaAction = MissingSchemaAction.AddWithKey}
|
||||
|
||||
_commandHelper = New SqliteCmdHelper()
|
||||
Case DbTypeEnum.Mssql
|
||||
_connection = New SqlConnection()
|
||||
_command = _connection.CreateCommand()
|
||||
_dataAdapter = New SqlDataAdapter() With {.MissingSchemaAction = MissingSchemaAction.AddWithKey}
|
||||
|
||||
_commandHelper = New MssqlCmdHelper()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Public ReadOnly Property DatabaseType() As DbTypeEnum
|
||||
Get
|
||||
Return _dbType
|
||||
End Get
|
||||
'Set(value As DbTypeEnum)
|
||||
' _dbType = value
|
||||
' '执行上一个数据库的关闭操作
|
||||
' InitByDbType(_dbType)
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Connection() As DbConnection
|
||||
Get
|
||||
Return _connection
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property Command() As DbCommand
|
||||
Get
|
||||
Return _command
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CmdHelper() As DbCmdHelper
|
||||
Get
|
||||
Return _commandHelper
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 打开数据库连接
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Open() As Boolean
|
||||
If _connection Is Nothing Then Return False
|
||||
If String.IsNullOrWhiteSpace(_connectionString) Then Return False
|
||||
Try
|
||||
_connection.ConnectionString = _connectionString
|
||||
_connection.Open()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 关闭数据库连接
|
||||
''' </summary>
|
||||
Public Sub Close()
|
||||
If _connection Is Nothing Then Return
|
||||
If _connection.State = ConnectionState.Closed Then Return
|
||||
_connection.Close()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建当前连接的命令执行句柄
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function CreateCommand() As DbCommand
|
||||
Return _connection.CreateCommand()
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 运行非查询语句,返回执行该语句受到影响的行数
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteNonQuery(commandText As String) As Integer
|
||||
Dim result As Integer
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
result = _command.ExecuteNonQuery()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 使用命令参数模式执行非查询语句,返回执行该语句受到影响的行数
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteNonQuery(commandText As String, commandParams As DbParameterCollection) As Integer
|
||||
Dim result As Integer
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
result = _command.ExecuteNonQuery()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回数据库读取流的句柄
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteReader(commandText As String) As DbDataReader
|
||||
Dim result As DbDataReader
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
result = _command.ExecuteReader()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 使用命令参数模式执行数据库语句,返回数据库读取流的句柄
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteReader(commandText As String, commandParams As DbParameterCollection) As DbDataReader
|
||||
Dim result As DbDataReader
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
result = _command.ExecuteReader()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回查询结果的第一行第一列的内容
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteScalar(commandText As String) As Object
|
||||
Dim result As Object
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
result = _command.ExecuteScalar()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 使用命令参数模式执行数据库语句,返回查询结果的第一行第一列的内容
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteScalar(commandText As String, commandParams As DbParameterCollection) As Object
|
||||
Dim result As Object
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
result = _command.ExecuteScalar()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回执行结果返回的数据表,常用于查询命令
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteDataTable(commandText As String, Optional withKey As Boolean = True) As DataTable
|
||||
Dim dataTable As New DataTable
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
If withKey Then
|
||||
_dataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
|
||||
Else
|
||||
_dataAdapter.MissingSchemaAction = MissingSchemaAction.Add
|
||||
End If
|
||||
_dataAdapter.SelectCommand = _command
|
||||
_dataAdapter.Fill(dataTable)
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
Return dataTable
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回执行结果返回的数据表,常用于查询命令
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteDataTable(commandText As String, commandParams As DbParameterCollection) As DataTable
|
||||
Dim dataTable As New DataTable
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
_dataAdapter.SelectCommand = _command
|
||||
_dataAdapter.Fill(dataTable)
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return dataTable
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 开启事务
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function BeginTransaction() As DbTransaction
|
||||
_transaction = _connection.BeginTransaction()
|
||||
Return _transaction
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 提交事务
|
||||
''' </summary>
|
||||
Public Sub CommitTransaction()
|
||||
Try
|
||||
_transaction.Commit()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 回滚事务
|
||||
''' </summary>
|
||||
Public Sub RollbackTransaction()
|
||||
Try
|
||||
_transaction.Rollback()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建数据参数
|
||||
''' </summary>
|
||||
''' <param name="type">参数数据类型</param>
|
||||
''' <param name="ParameterName">参数名称</param>
|
||||
''' <param name="value">参数值</param>
|
||||
''' <returns></returns>
|
||||
Public Function CreateDbParameter(type As DbType, parameterName As String, value As Object) As DbParameter
|
||||
Dim dbParam As DbParameter = _command.CreateParameter()
|
||||
dbParam.DbType = type
|
||||
dbParam.ParameterName = parameterName
|
||||
dbParam.Value = value
|
||||
Return dbParam
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 添加数据参数
|
||||
''' </summary>
|
||||
''' <param name="type"></param>
|
||||
''' <param name="parameterName"></param>
|
||||
''' <param name="value"></param>
|
||||
''' <returns></returns>
|
||||
Public Function AddDbParameter(type As DbType, parameterName As String, value As Object) As DbParameter
|
||||
Dim dbParam As DbParameter = _command.CreateParameter()
|
||||
dbParam.DbType = type
|
||||
dbParam.ParameterName = parameterName
|
||||
dbParam.Value = value
|
||||
_command.Parameters.Add(dbParam)
|
||||
Return dbParam
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空数据
|
||||
''' </summary>
|
||||
Public Sub ClearDbParameter()
|
||||
_command.Parameters.Clear()
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 回收资源
|
||||
''' </summary>
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
If _connection IsNot Nothing Then
|
||||
If _connection.State = ConnectionState.Open Then
|
||||
_connection.Close()
|
||||
End If
|
||||
_connection.Dispose()
|
||||
End If
|
||||
|
||||
If _command IsNot Nothing Then _command.Dispose()
|
||||
If _dataAdapter IsNot Nothing Then _dataAdapter.Dispose()
|
||||
|
||||
GC.Collect() '对所有缓存垃圾进行回收
|
||||
End Sub
|
||||
End Class
|
||||
10
Database/Mssql/MssqlCmdHelper.vb
Normal file
10
Database/Mssql/MssqlCmdHelper.vb
Normal file
@@ -0,0 +1,10 @@
|
||||
Namespace Database.Mssql
|
||||
Public Class MssqlCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "["c
|
||||
FiledPrefix = "]"c
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
8
Database/MssqlCmdHelper.vb
Normal file
8
Database/MssqlCmdHelper.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
Public Class MssqlCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "["c
|
||||
FiledPrefix = "]"c
|
||||
End Sub
|
||||
End Class
|
||||
222
Database/Mysql/DataParam.vb
Normal file
222
Database/Mysql/DataParam.vb
Normal file
@@ -0,0 +1,222 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Mysql
|
||||
Public Class DataParam
|
||||
Enum DataTypeEnum
|
||||
'###############################数值类型#############################
|
||||
''' <summary>
|
||||
''' 1 byte,小整数值
|
||||
''' </summary>
|
||||
Tinyint
|
||||
|
||||
''' <summary>
|
||||
''' 2 bytes,大整数值
|
||||
''' </summary>
|
||||
Smallint
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,大整数值
|
||||
''' </summary>
|
||||
Mediumint
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,大整数值
|
||||
''' </summary>
|
||||
Int
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,大整数值
|
||||
''' </summary>
|
||||
[Integer]
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,极大整数值
|
||||
''' </summary>
|
||||
Bigint
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,单精度浮点数值
|
||||
''' </summary>
|
||||
Float
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,双精度浮点数值
|
||||
''' </summary>
|
||||
[Double]
|
||||
|
||||
|
||||
|
||||
'####################日期类型###############################
|
||||
|
||||
''' <summary>
|
||||
''' 对DECIMAL(M,D) ,如果M>D,为M+2否则为D+2.小数值
|
||||
''' </summary>
|
||||
[Decimal]
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,日期值,YYYY-MM-DD
|
||||
''' </summary>
|
||||
[Date]
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,时间值或持续时间,HH:MM:SS
|
||||
''' </summary>
|
||||
Time
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 1 bytes,年份值,YYYY
|
||||
''' </summary>
|
||||
Year
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,混合日期和时间值,YYYY-MM-DD HH:MM:SS
|
||||
''' </summary>
|
||||
Datetime
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,混合日期和时间值,时间戳,YYYYMMDD HHMMSS
|
||||
''' </summary>
|
||||
Timestamp
|
||||
|
||||
|
||||
'####################字符类型###############################
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,定长字符串
|
||||
''' </summary>
|
||||
[Char]
|
||||
|
||||
''' <summary>
|
||||
''' 0-65535 bytes,变长字符串
|
||||
''' </summary>
|
||||
Varchar
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,不超过 255 个字符的二进制字符串
|
||||
''' </summary>
|
||||
Tinyblob
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,短文本字符串
|
||||
''' </summary>
|
||||
Tinytext
|
||||
|
||||
''' <summary>
|
||||
''' 0-65 535 bytes,二进制形式的长文本数据
|
||||
''' </summary>
|
||||
Blob
|
||||
|
||||
''' <summary>
|
||||
''' 0-65 535 bytes,长文本数据
|
||||
''' </summary>
|
||||
Text
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 0-16 777 215 bytes,二进制形式的中等长度文本数据
|
||||
''' </summary>
|
||||
Mediumblob
|
||||
|
||||
''' <summary>
|
||||
''' 0-16 777 215 bytes,中等长度文本数据
|
||||
''' </summary>
|
||||
Mediumtext
|
||||
|
||||
''' <summary>
|
||||
''' 0-4 294 967 295 bytes,二进制形式的极大文本数据
|
||||
''' </summary>
|
||||
Longblob
|
||||
|
||||
''' <summary>
|
||||
''' 0-4 294 967 295 bytes,极大文本数据
|
||||
''' </summary>
|
||||
Longtext
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As DataTypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型是否带符号
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsUnsigned() As Boolean
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case DataTypeEnum.Varchar,DataTypeEnum.[Char]
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case DataTypeEnum.Int
|
||||
sb.Append($" {DataType}")
|
||||
if IsUnsigned Then sb.Append($" Unsigned")
|
||||
If IsAutoIncrement Then sb.Append($" AUTO_INCREMENT")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
13
Database/Mysql/MysqlCmdHelper.vb
Normal file
13
Database/Mysql/MysqlCmdHelper.vb
Normal file
@@ -0,0 +1,13 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Mysql
|
||||
Public Class MysqlCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New
|
||||
FiledSuffix = "`"c
|
||||
FiledPrefix = "`"c
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
9
Database/MysqlCmdHelper.vb
Normal file
9
Database/MysqlCmdHelper.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Public Class MysqlCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "`"c
|
||||
FiledPrefix = "`"c
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
220
Database/MysqlDataParam.vb
Normal file
220
Database/MysqlDataParam.vb
Normal file
@@ -0,0 +1,220 @@
|
||||
Imports System.Text
|
||||
|
||||
Public Class MysqlDataParam
|
||||
Enum DataTypeEnum
|
||||
'###############################数值类型#############################
|
||||
''' <summary>
|
||||
''' 1 byte,小整数值
|
||||
''' </summary>
|
||||
Tinyint
|
||||
|
||||
''' <summary>
|
||||
''' 2 bytes,大整数值
|
||||
''' </summary>
|
||||
Smallint
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,大整数值
|
||||
''' </summary>
|
||||
Mediumint
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,大整数值
|
||||
''' </summary>
|
||||
Int
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,大整数值
|
||||
''' </summary>
|
||||
[Integer]
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,极大整数值
|
||||
''' </summary>
|
||||
Bigint
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,单精度浮点数值
|
||||
''' </summary>
|
||||
Float
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,双精度浮点数值
|
||||
''' </summary>
|
||||
[Double]
|
||||
|
||||
|
||||
|
||||
'####################日期类型###############################
|
||||
|
||||
''' <summary>
|
||||
''' 对DECIMAL(M,D) ,如果M>D,为M+2否则为D+2.小数值
|
||||
''' </summary>
|
||||
[Decimal]
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,日期值,YYYY-MM-DD
|
||||
''' </summary>
|
||||
[Date]
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,时间值或持续时间,HH:MM:SS
|
||||
''' </summary>
|
||||
Time
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 1 bytes,年份值,YYYY
|
||||
''' </summary>
|
||||
Year
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,混合日期和时间值,YYYY-MM-DD HH:MM:SS
|
||||
''' </summary>
|
||||
Datetime
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,混合日期和时间值,时间戳,YYYYMMDD HHMMSS
|
||||
''' </summary>
|
||||
Timestamp
|
||||
|
||||
|
||||
'####################字符类型###############################
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,定长字符串
|
||||
''' </summary>
|
||||
[Char]
|
||||
|
||||
''' <summary>
|
||||
''' 0-65535 bytes,变长字符串
|
||||
''' </summary>
|
||||
Varchar
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,不超过 255 个字符的二进制字符串
|
||||
''' </summary>
|
||||
Tinyblob
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,短文本字符串
|
||||
''' </summary>
|
||||
Tinytext
|
||||
|
||||
''' <summary>
|
||||
''' 0-65 535 bytes,二进制形式的长文本数据
|
||||
''' </summary>
|
||||
Blob
|
||||
|
||||
''' <summary>
|
||||
''' 0-65 535 bytes,长文本数据
|
||||
''' </summary>
|
||||
Text
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 0-16 777 215 bytes,二进制形式的中等长度文本数据
|
||||
''' </summary>
|
||||
Mediumblob
|
||||
|
||||
''' <summary>
|
||||
''' 0-16 777 215 bytes,中等长度文本数据
|
||||
''' </summary>
|
||||
Mediumtext
|
||||
|
||||
''' <summary>
|
||||
''' 0-4 294 967 295 bytes,二进制形式的极大文本数据
|
||||
''' </summary>
|
||||
Longblob
|
||||
|
||||
''' <summary>
|
||||
''' 0-4 294 967 295 bytes,极大文本数据
|
||||
''' </summary>
|
||||
Longtext
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As DataTypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型是否带符号
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsUnsigned() As Boolean
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case DataTypeEnum.Varchar, DataTypeEnum.[Char]
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case DataTypeEnum.Int
|
||||
sb.Append($" {DataType}")
|
||||
If IsUnsigned Then sb.Append($" Unsigned")
|
||||
If IsAutoIncrement Then sb.Append($" AUTO_INCREMENT")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
106
Database/Sqlite/DataParam.vb
Normal file
106
Database/Sqlite/DataParam.vb
Normal file
@@ -0,0 +1,106 @@
|
||||
Imports System.Text
|
||||
|
||||
Namespace Database.Sqlite
|
||||
Public Class DataParam
|
||||
Enum DataTypeEnum
|
||||
Varchar
|
||||
Nchar
|
||||
Blob
|
||||
Bit
|
||||
Datetime
|
||||
[Decimal]
|
||||
Real
|
||||
UniqueIdentifier
|
||||
Int
|
||||
[Integer]
|
||||
TinyInt
|
||||
[Single]
|
||||
Nvarchar
|
||||
SmallInt
|
||||
SmallUint
|
||||
Uint
|
||||
UnsignedInteger
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As DataTypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为唯一值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsUnique() As Boolean
|
||||
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case DataTypeEnum.Varchar, DataTypeEnum.Nchar, DataTypeEnum.Nvarchar
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case DataTypeEnum.Int,DataTypeEnum.Integer
|
||||
sb.Append($" {DataType}")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
If IsAutoIncrement Then sb.Append($" AUTOINCREMENT")
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
20
Database/Sqlite/SqliteCmdHelper.vb
Normal file
20
Database/Sqlite/SqliteCmdHelper.vb
Normal file
@@ -0,0 +1,20 @@
|
||||
Namespace Database.Sqlite
|
||||
Public Class SqliteCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "["c
|
||||
FiledPrefix = "]"c
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="tableName"></param>
|
||||
''' <returns></returns>
|
||||
Public Overrides Function SearchTableInfo(tableName As String) As String
|
||||
Return $"select * from sqlite_master where tbl_name = '{tableName}';"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
19
Database/SqliteCmdHelper.vb
Normal file
19
Database/SqliteCmdHelper.vb
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
Public Class SqliteCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "["c
|
||||
FiledPrefix = "]"c
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="tableName"></param>
|
||||
''' <returns></returns>
|
||||
Public Overrides Function SearchTableInfo(tableName As String) As String
|
||||
Return $"select * from sqlite_master where tbl_name = '{tableName}';"
|
||||
End Function
|
||||
|
||||
End Class
|
||||
105
Database/SqliteDataParam.vb
Normal file
105
Database/SqliteDataParam.vb
Normal file
@@ -0,0 +1,105 @@
|
||||
Imports System.Text
|
||||
|
||||
|
||||
Public Class SqliteDataParam
|
||||
Enum DataTypeEnum
|
||||
Varchar
|
||||
Nchar
|
||||
Blob
|
||||
Bit
|
||||
Datetime
|
||||
[Decimal]
|
||||
Real
|
||||
UniqueIdentifier
|
||||
Int
|
||||
[Integer]
|
||||
TinyInt
|
||||
[Single]
|
||||
Nvarchar
|
||||
SmallInt
|
||||
SmallUint
|
||||
Uint
|
||||
UnsignedInteger
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As DataTypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为唯一值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsUnique() As Boolean
|
||||
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case DataTypeEnum.Varchar, DataTypeEnum.Nchar, DataTypeEnum.Nvarchar
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case DataTypeEnum.Int, DataTypeEnum.Integer
|
||||
sb.Append($" {DataType}")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
If IsAutoIncrement Then sb.Append($" AUTOINCREMENT")
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
747
DbCmdHelper.vb
Normal file
747
DbCmdHelper.vb
Normal file
@@ -0,0 +1,747 @@
|
||||
Imports System.Text
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据库语句助手
|
||||
''' 时间:2020-12-21
|
||||
''' 作者:ML
|
||||
''' 版本:1.0
|
||||
'''
|
||||
''' 注意:添加一条数据库帮助语句时,需要考虑Mysql/Sqlite/Mssql等数据库是否支持命令,不支持则需要在对应帮助类中重写该帮助语句
|
||||
''' 注意:Sqlite数据库与大多数据库不相同,DB开头数据库语句大多不适用
|
||||
'''
|
||||
''' </summary>
|
||||
Public MustInherit Class DbCmdHelper
|
||||
Protected FiledSuffix As Char
|
||||
Protected FiledPrefix As Char
|
||||
|
||||
Public Shared Function CreateCmdHelper(type As DbExecutor.DbTypeEnum) As DbCmdHelper
|
||||
Select Case type
|
||||
Case DbExecutor.DbTypeEnum.Mysql
|
||||
Return New MysqlCmdHelper()
|
||||
Case DbExecutor.DbTypeEnum.Mssql
|
||||
Return New MssqlCmdHelper()
|
||||
Case DbExecutor.DbTypeEnum.Sqlite
|
||||
Return New SqliteCmdHelper()
|
||||
Case Else
|
||||
Throw New Exception($"CreateCmdHelper :Unknown Type {type}")
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
#Region "访问单数据库连接"
|
||||
''' <summary>
|
||||
''' 查询指定数据表符合条件的所有数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="condition">查询条件,</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchAll(tableName As String, Optional condition As String = "") As String
|
||||
If String.IsNullOrWhiteSpace(condition) Then
|
||||
Return $"Select * FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select * FROM {FiledSuffix}{tableName}{FiledPrefix} WHERE {condition};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="columnName">列名集合,需要返回多列时用','符号分隔列名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Search(columnName As String, tableName As String, Optional condition As String = "") As String
|
||||
If String.IsNullOrWhiteSpace(condition) Then
|
||||
Return $"Select {columnName} FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select {columnName} FROM {FiledSuffix}{tableName}{FiledPrefix} WHERE {condition};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="columnName">表名</param>
|
||||
''' <param name="tableName">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Search(columnName As List(Of String), tableName As String, Optional condition As String = "") As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
End If
|
||||
Next
|
||||
|
||||
If String.IsNullOrWhiteSpace(condition) Then
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix} Where {condition};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Overridable Function SearchOrder(columnName As List(Of String), tableName As String, Optional orderString As String = "") As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
End If
|
||||
Next
|
||||
|
||||
If String.IsNullOrWhiteSpace(orderString) Then
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
Else
|
||||
Return $"Select {colNameString} FROM {FiledSuffix}{tableName}{FiledPrefix} {orderString};"
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定表包含的内容行数
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <param name="condition">查询条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchCount(tableName As String, Optional condition As String = "") As String
|
||||
Return Search("count(*)", tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchTableInfo(tableName As String) As String
|
||||
Return $"Select * from information_schema.tables where table_name = '{tableName}';"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表是否存在的信息,返回查询当前表在数据库中存在的数量
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function SearchTableExists(tableName As String) As String
|
||||
Return $"Select count(*) from information_schema.tables where table_name = '{tableName}';"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colNames">列名字符串</param>
|
||||
''' <param name="values">列值字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Insert(tableName As String, colNames As String, values As String) As String
|
||||
Return $"Insert into {FiledSuffix}{tableName}{FiledPrefix} ({colNames}) Values ( {values} );"
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="dicNameValues">列名与列值键值对</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Insert(tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
Public Overridable Function Insert2(tableName As String, dicNameValues As Dictionary(Of String, Object )) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, Object) In dicNameValues
|
||||
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行,通过命令参数方式执行时使用
|
||||
''' </summary>
|
||||
''' <param name="tableName"></param>
|
||||
''' <param name="dicNameValues"></param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function InsertParam(tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"{keyValuePair.Value}")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",{keyValuePair.Value}")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据表插入一行,通过命令参数方式执行时使用,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colNames">字段列表</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function InsertParam(tableName As String, colNames As List(Of String)) As String
|
||||
Dim colNameString As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If colNameString.Length = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{colName}{FiledPrefix}")
|
||||
values.Append($"@{colName}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{colName}{FiledPrefix}")
|
||||
values.Append($",@{colName}")
|
||||
End If
|
||||
Next
|
||||
Return Insert(tableName, colNameString.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定表数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="destStr">更新字符串</param>
|
||||
''' <param name="condition"></param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Update(tableName As String, destStr As String, condition As String) As String
|
||||
Return $"Update {FiledSuffix}{tableName}{FiledPrefix} Set {destStr} Where {condition};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定表数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="dicNameValues">更新列名与列值键值对</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function Update(tableName As String, dicNameValues As Dictionary(Of String, String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix} = '{keyValuePair.Value}'")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix} = '{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return Update(tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="colNames">更新列名的集合</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function UpdateParam(tableName As String, colNames As List(Of String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
End If
|
||||
Next
|
||||
Return Update(tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据表增加一列数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">列名</param>
|
||||
''' <param name="colType">列类型</param>
|
||||
''' <param name="isNull">是否允许为空</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function AddCol(tableName As String, colName As String, colType As String, Optional isNull As Boolean = True) As String
|
||||
Return $"Alter Table {FiledSuffix}{tableName}{FiledPrefix} Add {FiledSuffix}{colName}{FiledPrefix} {colType} {IIf(isNull, "Default Null", "Not Null")};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 数据表删除一列数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">需要删除的列名,仅一列</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropCol(tableName As String, colName As String) As String
|
||||
Return $"Alter Table {FiledSuffix}{tableName}{FiledPrefix} Drop Column {FiledSuffix}{colName}{FiledPrefix};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 删除指定表多行数据
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DeleteRows(tableName As String, condition As String) As String
|
||||
Return $"Delete From {FiledSuffix}{tableName}{FiledPrefix} Where {condition};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 创建数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function CreateTable(tableName As String, createStr As String) As String
|
||||
Return $"Create Table {FiledSuffix}{tableName}{FiledPrefix} ( {createStr} );"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 创建数据表,如果存在则不创建
|
||||
''' </summary>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function CreateTableWhenNotExists(tableName As String, createStr As String) As String
|
||||
Return $"Create Table if not exists {FiledSuffix}{tableName}{FiledPrefix} ( {createStr} );"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空数据表,表依旧存在
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DeleteTable(tableName As String) As String
|
||||
Return $"Delete From {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 删除数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropTable(tableName As String) As String
|
||||
Return $"Drop Table {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 删除数据表
|
||||
''' </summary>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DropTableWhenExists(tableName As String) As String
|
||||
Return $"Drop Table If Exists {FiledSuffix}{tableName}{FiledPrefix};"
|
||||
End Function
|
||||
#End Region
|
||||
|
||||
|
||||
#Region "访问多数据库连接"
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="ColsName">列名集合,需要返回多列时用','符号分隔列名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearch(dbName As String, colsName As String, tableName As String, Optional condition As String = "") As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Select {colsName} From ")
|
||||
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
|
||||
If String.IsNullOrWhiteSpace(condition) = False Then
|
||||
cmdText.Append($" WHERE {condition}")
|
||||
End If
|
||||
|
||||
cmdText.Append($";")
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有指定列的去重数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="ColsName">列名集合,需要返回多列时用','符号分隔列名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDistinctSearch(dbName As String, colsName As String, tableName As String, Optional condition As String = "") As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Select Distinct {colsName} From ")
|
||||
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
|
||||
If String.IsNullOrWhiteSpace(condition) = False Then
|
||||
cmdText.Append($" WHERE {condition}")
|
||||
End If
|
||||
|
||||
cmdText.Append($";")
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有指定列的数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="columnName">表名</param>
|
||||
''' <param name="tableName">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearch(dbName As String, columnName As List(Of String), tableName As String, Optional condition As String = "") As String
|
||||
Dim colNameString As New StringBuilder
|
||||
For i As Integer = 0 To columnName.Count - 1
|
||||
If i = 0 Then
|
||||
colNameString.Append($"{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
Else
|
||||
colNameString.Append($",{FiledSuffix}{columnName(i)}{FiledPrefix}")
|
||||
End If
|
||||
Next
|
||||
|
||||
Return DbSearch(dbName, colNameString.ToString(), tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定表包含的内容行数
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <param name="condition">查询条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchCount(dbName As String, tableName As String, Optional condition As String = "") As String
|
||||
Return DbSearch(dbName, "count(*)", tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表符合条件的所有数据
|
||||
'''
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <param name="condition">查询条件(可选)</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchAll(dbName As String, tableName As String, Optional condition As String = "") As String
|
||||
Return DbSearch(dbName, "*", tableName, condition)
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据库中指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchTableInfo(dbName As String, tableName As String) As String
|
||||
Return DbSearch("", "*", "information_schema.tables", "table_schema = '{dbName}' and table_name = '{tableName}'")
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表是否存在的信息,返回查询当前表在指定数据库中存在的数量
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbSearchTableExists(dbName As String, tableName As String) As String
|
||||
Return DbSearch("", "count(*)", "information_schema.tables", "table_schema = '{dbName}' and table_name = '{tableName}'")
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colNames">列名字符串</param>
|
||||
''' <param name="values">列值字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbInsert(dbName As String, tableName As String, colNames As String, values As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Insert into ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" ({colNames}) Values ( {values} );")
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表插入一行数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="dicNameValues">列名与列值键值对</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbInsert(dbName As String, tableName As String, dicNameValues As Dictionary(Of String, String)) As String
|
||||
Dim colNames As New StringBuilder
|
||||
Dim values As New StringBuilder
|
||||
For Each keyValuePair As KeyValuePair(Of String, String) In dicNameValues
|
||||
If colNames.Length = 0 Then
|
||||
colNames.Append($"{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($"'{keyValuePair.Value}'")
|
||||
Else
|
||||
colNames.Append($",{FiledSuffix}{keyValuePair.Key}{FiledPrefix}")
|
||||
values.Append($",'{keyValuePair.Value}'")
|
||||
End If
|
||||
Next
|
||||
|
||||
Return DbInsert(dbName, tableName, colNames.ToString(), values.ToString())
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表插入一行,通过命令参数方式执行时使用,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName"></param>
|
||||
''' <param name="colNames">需要插入列名的集合</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbInsertParam(dbName As String, tableName As String, colNames As List(Of String)) As String
|
||||
Dim colNameBuilder As New StringBuilder
|
||||
Dim valueBuilder As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If colNameBuilder.Length = 0 Then
|
||||
colNameBuilder.Append($"{FiledSuffix}{colName}{FiledPrefix}")
|
||||
valueBuilder.Append($"@{colName}")
|
||||
Else
|
||||
colNameBuilder.Append($",{FiledSuffix}{colName}{FiledPrefix}")
|
||||
valueBuilder.Append($",@{colName}")
|
||||
End If
|
||||
Next
|
||||
'insert into dbName.tablename (1,2,3) value (@1,@2,@3)
|
||||
Return DbInsert(dbName, tableName, colNameBuilder.ToString(), valueBuilder.ToString())
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="destStr">更新字符串</param>
|
||||
''' <param name="condition"></param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbUpdate(dbName As String, tableName As String, destStr As String, condition As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
Dim tmpStrCmdText As String = ""
|
||||
|
||||
cmdText.Append($"Update ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Set {destStr} Where {condition};")
|
||||
tmpStrCmdText = cmdText.ToString()
|
||||
Console.WriteLine("SQL_CMD = " & tmpStrCmdText)
|
||||
|
||||
Return tmpStrCmdText
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据,参数名由@{ColName}
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="colNames">更新列名的集合</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbUpdateParam(dbName As String, tableName As String, colNames As List(Of String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each colName As String In colNames
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{colName}{FiledPrefix} = @{colName}")
|
||||
End If
|
||||
Next
|
||||
Return DbUpdate(dbName, tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 更新指定数据库中指定表数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">指定表名</param>
|
||||
''' <param name="filedDictionary">更新列名与列值键值对</param>
|
||||
''' <param name="condition">更新列索引条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbUpdate(dbName As String, tableName As String, filedDictionary As Dictionary(Of String, String), condition As String) As String
|
||||
Dim destStr As New StringBuilder
|
||||
For Each filed As KeyValuePair(Of String, String) In filedDictionary
|
||||
If destStr.Length = 0 Then
|
||||
destStr.Append($"{FiledSuffix}{filed.Key}{FiledPrefix} = '{filed.Value}'")
|
||||
Else
|
||||
destStr.Append($",{FiledSuffix}{filed.Key}{FiledPrefix} = '{filed.Value}'")
|
||||
End If
|
||||
Next
|
||||
Return DbUpdate(dbName, tableName, destStr.ToString(), condition)
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中指定数据表增加一列数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">列名</param>
|
||||
''' <param name="colType">列类型</param>
|
||||
''' <param name="isNull">是否允许为空</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbAddCol(dbName As String, tableName As String, colName As String, colType As String, Optional isNull As Boolean = True) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Alter Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Add {FiledSuffix}{colName}{FiledPrefix} {colType} {IIf(isNull, "Default Null", "Not Null")};")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中数据表删除一列数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="colName">需要删除的列名,仅一列</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDropCol(dbName As String, tableName As String, colName As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Alter Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Drop Column {FiledSuffix}{colName}{FiledPrefix};")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中指定表删除多行数据
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="condition">条件</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDeleteRows(dbName As String, tableName As String, condition As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Delete From ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" Where {condition};")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中创建数据表
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbCreateTable(dbName As String, tableName As String, createStr As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Create Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" ( {createStr} );")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 指定数据库中创建数据表,如果存在则不创建
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">表名</param>
|
||||
''' <param name="createStr">创建表的列信息字符串</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbCreateTableWhenNotExists(dbName As String, tableName As String, createStr As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Create Table if not exists ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($" ( {createStr} );")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空指定数据库中数据表,表依旧存在
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDeleteTable(dbName As String, tableName As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Delete From ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($";")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 删除指定数据库中数据表
|
||||
''' </summary>
|
||||
''' <param name="dbName">数据库名</param>
|
||||
''' <param name="tableName">数据表名</param>
|
||||
''' <returns></returns>
|
||||
Public Overridable Function DbDropTable(dbName As String, tableName As String) As String
|
||||
Dim cmdText As New StringBuilder
|
||||
cmdText.Append($"Drop Table ")
|
||||
If String.IsNullOrEmpty(dbName) = False Then
|
||||
cmdText.Append($"{FiledSuffix}{dbName}{FiledPrefix}.")
|
||||
End If
|
||||
cmdText.Append($"{FiledSuffix}{tableName}{FiledPrefix}")
|
||||
cmdText.Append($";")
|
||||
|
||||
Return cmdText.ToString()
|
||||
End Function
|
||||
#End Region
|
||||
End Class
|
||||
377
DbExecutor.vb
Normal file
377
DbExecutor.vb
Normal file
@@ -0,0 +1,377 @@
|
||||
Imports System.Data.Common
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Data.SQLite
|
||||
Imports MySql.Data.MySqlClient
|
||||
|
||||
''' <summary>
|
||||
''' 数据库通用命令执行器
|
||||
''' 时间:2020-12-21
|
||||
''' 作者:ML
|
||||
''' 版本:1.0
|
||||
''' </summary>
|
||||
Public Class DbExecutor
|
||||
Implements IDisposable
|
||||
''' <summary>
|
||||
''' 数据库类型,目前支持Mysql与Sqlite
|
||||
''' </summary>
|
||||
Enum DbTypeEnum
|
||||
Mysql
|
||||
Sqlite
|
||||
Mssql
|
||||
End Enum
|
||||
|
||||
|
||||
Private ReadOnly _connectionString As String '数据库连接语句
|
||||
|
||||
Private ReadOnly _dbType As DbTypeEnum '数据库类型
|
||||
|
||||
Private _connection As DbConnection '数据库连接句柄
|
||||
|
||||
Private _command As DbCommand '数据库命令句柄
|
||||
|
||||
Private _dataAdapter As DbDataAdapter '数据库查询填充器句柄
|
||||
|
||||
Private _transaction As DbTransaction '数据库事务句柄
|
||||
|
||||
Private _commandHelper As DbCmdHelper '数据库语句填充助手
|
||||
|
||||
Sub New(type As DbTypeEnum, connectionString As String)
|
||||
_dbType = type
|
||||
_connectionString = connectionString
|
||||
InitByDbType(_dbType)
|
||||
End Sub
|
||||
|
||||
Private Sub InitByDbType(type As DbTypeEnum)
|
||||
Select Case type
|
||||
Case DbTypeEnum.Mysql
|
||||
_connection = New MySqlConnection()
|
||||
_command = _connection.CreateCommand()
|
||||
_dataAdapter = New MySqlDataAdapter() With {.MissingSchemaAction = MissingSchemaAction.AddWithKey}
|
||||
|
||||
_commandHelper = New MysqlCmdHelper()
|
||||
Case DbTypeEnum.Sqlite
|
||||
_connection = New SqliteConnection()
|
||||
_command = _connection.CreateCommand()
|
||||
_dataAdapter = New SQLiteDataAdapter() With {.MissingSchemaAction = MissingSchemaAction.AddWithKey}
|
||||
|
||||
_commandHelper = New SqliteCmdHelper()
|
||||
Case DbTypeEnum.Mssql
|
||||
_connection = New SqlConnection()
|
||||
_command = _connection.CreateCommand()
|
||||
_dataAdapter = New SqlDataAdapter() With {.MissingSchemaAction = MissingSchemaAction.AddWithKey}
|
||||
|
||||
_commandHelper = New MssqlCmdHelper()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Public ReadOnly Property DatabaseType() As DbTypeEnum
|
||||
Get
|
||||
Return _dbType
|
||||
End Get
|
||||
'Set(value As DbTypeEnum)
|
||||
' _dbType = value
|
||||
' '执行上一个数据库的关闭操作
|
||||
' InitByDbType(_dbType)
|
||||
'End Set
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property Connection() As DbConnection
|
||||
Get
|
||||
Return _connection
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
Public ReadOnly Property Command() As DbCommand
|
||||
Get
|
||||
Return _command
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Public ReadOnly Property CmdHelper() As DbCmdHelper
|
||||
Get
|
||||
Return _commandHelper
|
||||
End Get
|
||||
End Property
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 打开数据库连接
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function Open() As Boolean
|
||||
If _connection Is Nothing Then Return False
|
||||
If String.IsNullOrWhiteSpace(_connectionString) Then Return False
|
||||
Try
|
||||
_connection.ConnectionString = _connectionString
|
||||
_connection.Open()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return True
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 关闭数据库连接
|
||||
''' </summary>
|
||||
Public Sub Close()
|
||||
If _connection Is Nothing Then Return
|
||||
If _connection.State = ConnectionState.Closed Then Return
|
||||
_connection.Close()
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建当前连接的命令执行句柄
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function CreateCommand() As DbCommand
|
||||
Return _connection.CreateCommand()
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 运行非查询语句,返回执行该语句受到影响的行数
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteNonQuery(commandText As String) As Integer
|
||||
Dim result As Integer
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
result = _command.ExecuteNonQuery()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 使用命令参数模式执行非查询语句,返回执行该语句受到影响的行数
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteNonQuery(commandText As String, commandParams As DbParameterCollection) As Integer
|
||||
Dim result As Integer
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
result = _command.ExecuteNonQuery()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回数据库读取流的句柄
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteReader(commandText As String) As DbDataReader
|
||||
Dim result As DbDataReader
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
result = _command.ExecuteReader()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 使用命令参数模式执行数据库语句,返回数据库读取流的句柄
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteReader(commandText As String, commandParams As DbParameterCollection) As DbDataReader
|
||||
Dim result As DbDataReader
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
result = _command.ExecuteReader()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回查询结果的第一行第一列的内容
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteScalar(commandText As String) As Object
|
||||
Dim result As Object
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
result = _command.ExecuteScalar()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 使用命令参数模式执行数据库语句,返回查询结果的第一行第一列的内容
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteScalar(commandText As String, commandParams As DbParameterCollection) As Object
|
||||
Dim result As Object
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
result = _command.ExecuteScalar()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return result
|
||||
End Function
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回执行结果返回的数据表,常用于查询命令
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteDataTable(commandText As String, Optional withKey As Boolean = True) As DataTable
|
||||
Dim dataTable As New DataTable
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
If withKey Then
|
||||
_dataAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
|
||||
Else
|
||||
_dataAdapter.MissingSchemaAction = MissingSchemaAction.Add
|
||||
End If
|
||||
_dataAdapter.SelectCommand = _command
|
||||
_dataAdapter.Fill(dataTable)
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
Return dataTable
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 执行数据库语句,返回执行结果返回的数据表,常用于查询命令
|
||||
''' </summary>
|
||||
''' <param name="commandText">执行的数据库命令文本</param>
|
||||
''' <param name="commandParams">执行的数据库命令参数</param>
|
||||
''' <returns></returns>
|
||||
Public Function ExecuteDataTable(commandText As String, commandParams As DbParameterCollection) As DataTable
|
||||
Dim dataTable As New DataTable
|
||||
Try
|
||||
_command.CommandText = commandText
|
||||
_command.Parameters.Clear()
|
||||
For Each param As DbParameter In commandParams
|
||||
_command.Parameters.Add(param)
|
||||
Next
|
||||
_dataAdapter.SelectCommand = _command
|
||||
_dataAdapter.Fill(dataTable)
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
Return dataTable
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 开启事务
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Function BeginTransaction() As DbTransaction
|
||||
_transaction = _connection.BeginTransaction()
|
||||
Return _transaction
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 提交事务
|
||||
''' </summary>
|
||||
Public Sub CommitTransaction()
|
||||
Try
|
||||
_transaction.Commit()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 回滚事务
|
||||
''' </summary>
|
||||
Public Sub RollbackTransaction()
|
||||
Try
|
||||
_transaction.Rollback()
|
||||
Catch ex As Exception
|
||||
Throw
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建数据参数
|
||||
''' </summary>
|
||||
''' <param name="type">参数数据类型</param>
|
||||
''' <param name="ParameterName">参数名称</param>
|
||||
''' <param name="value">参数值</param>
|
||||
''' <returns></returns>
|
||||
Public Function CreateDbParameter(type As DbType, parameterName As String, value As Object) As DbParameter
|
||||
Dim dbParam As DbParameter = _command.CreateParameter()
|
||||
dbParam.DbType = type
|
||||
dbParam.ParameterName = parameterName
|
||||
dbParam.Value = value
|
||||
Return dbParam
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 添加数据参数
|
||||
''' </summary>
|
||||
''' <param name="type"></param>
|
||||
''' <param name="parameterName"></param>
|
||||
''' <param name="value"></param>
|
||||
''' <returns></returns>
|
||||
Public Function AddDbParameter(type As DbType, parameterName As String, value As Object) As DbParameter
|
||||
Dim dbParam As DbParameter = _command.CreateParameter()
|
||||
dbParam.DbType = type
|
||||
dbParam.ParameterName = parameterName
|
||||
dbParam.Value = value
|
||||
_command.Parameters.Add(dbParam)
|
||||
Return dbParam
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 清空数据
|
||||
''' </summary>
|
||||
Public Sub ClearDbParameter()
|
||||
_command.Parameters.Clear()
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 回收资源
|
||||
''' </summary>
|
||||
Public Sub Dispose() Implements IDisposable.Dispose
|
||||
If _connection IsNot Nothing Then
|
||||
If _connection.State = ConnectionState.Open Then
|
||||
_connection.Close()
|
||||
End If
|
||||
_connection.Dispose()
|
||||
End If
|
||||
|
||||
If _command IsNot Nothing Then _command.Dispose()
|
||||
If _dataAdapter IsNot Nothing Then _dataAdapter.Dispose()
|
||||
|
||||
GC.Collect() '对所有缓存垃圾进行回收
|
||||
End Sub
|
||||
End Class
|
||||
207
FTP/UtsFtp.vb
Normal file
207
FTP/UtsFtp.vb
Normal file
@@ -0,0 +1,207 @@
|
||||
Imports System.Threading
|
||||
Imports FluentFTP
|
||||
|
||||
Namespace UTSModule
|
||||
Public Class UtsFtp
|
||||
''' <summary>测试器句柄,全局唯一</summary>
|
||||
Private Shared _object As UtsFtp
|
||||
|
||||
''' <summary>初始化测试器线程锁</summary>
|
||||
Private Shared ReadOnly InitLock As New Object()
|
||||
|
||||
Private Shared FtpPort As Integer
|
||||
Private Shared FtpUser As String
|
||||
Private Shared FtpPwd As String
|
||||
|
||||
Private _ftpUser As String
|
||||
Private _ftpPwd As String
|
||||
Private _ftpPort As Integer
|
||||
Private _ftpHost As String
|
||||
|
||||
Private Default_FTP_Host As String = "blv-oa.com"
|
||||
|
||||
''' <summary>
|
||||
''' 初始化FTP连接参数
|
||||
''' </summary>
|
||||
''' <param name="port">端口号</param>
|
||||
''' <param name="user">用户名</param>
|
||||
''' <param name="pwd">用户密码</param>
|
||||
Public Shared Sub InitConnectParams(port As Integer, user As String, pwd As String)
|
||||
FtpPort = port
|
||||
FtpUser = user
|
||||
FtpPwd = pwd
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 创建类单例对象
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Shared Function CreateObject() As UtsFtp
|
||||
If _object Is Nothing Then
|
||||
SyncLock InitLock
|
||||
Thread.MemoryBarrier()
|
||||
If _object Is Nothing Then
|
||||
_object = New UtsFtp("blv-oa.com", FtpPort, FtpUser, FtpPwd)
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
Return _object
|
||||
End Function
|
||||
|
||||
Private Sub New(host As String, port As Integer, user As String, pwd As String)
|
||||
_ftpHost = host
|
||||
_ftpPort = port
|
||||
_ftpUser = user
|
||||
_ftpPwd = pwd
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' Ftp服务器地址
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property FtpHost As String
|
||||
Get
|
||||
Return _ftpHost
|
||||
End Get
|
||||
Set(value As String)
|
||||
_ftpHost = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub OnValidateCertificate(control As FtpClient, e As FtpSslValidationEventArgs)
|
||||
e.Accept = True
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 判断FTP文件是否存在
|
||||
''' </summary>
|
||||
''' <param name="path"></param>
|
||||
''' <returns></returns>
|
||||
Public Function FtpFileExists(path As String) As Boolean
|
||||
Dim result As Boolean
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
result = ftpClient.FileExists(path)
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
|
||||
Return result
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 创建Ftp文件夹
|
||||
''' </summary>
|
||||
''' <param name="remoteDir">Ftp文件夹路径</param>
|
||||
''' <param name="force">创建所有不存在的文件夹路径</param>
|
||||
Public Sub CreateDir(remoteDir As String, Optional force As Boolean = False)
|
||||
Using ftpClient As FtpClient = New FtpClient(FtpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
ftpClient.CreateDirectory(remoteDir, force)
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
End Sub
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 上传本地文件至Ftp
|
||||
''' 将本地指定路径压缩包上传到FTP服务器上manager文件夹下
|
||||
''' </summary>
|
||||
Public Function FtpUpload2(remotePath As String, loadPath As String) As FtpStatus
|
||||
Dim ftpstart As FtpStatus
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
ftpstart = ftpClient.UploadFile(loadPath, remotePath, FtpRemoteExists.Overwrite, True)
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
Return ftpstart
|
||||
|
||||
End Function
|
||||
Public Function FtpUpload(remotePath As String, loadPath As String) As FtpStatus
|
||||
Dim ftpstart As FtpStatus
|
||||
Dim datS As String = remotePath.Replace(".xml", ".dat")
|
||||
Dim datl As String = loadPath.Replace(".xml", ".dat")
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
ftpstart = ftpClient.UploadFile(loadPath, remotePath, FtpRemoteExists.Overwrite, True)
|
||||
ftpstart = ftpClient.UploadFile(datl, datS, FtpRemoteExists.Overwrite, True)
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
Return ftpstart
|
||||
|
||||
End Function
|
||||
|
||||
''' <summary>
|
||||
''' 从Ftp下载文件至本地
|
||||
''' 从FTP下载压缩包,到本地指定路径
|
||||
''' </summary>
|
||||
Public Overloads Function FtpDownload(remotePath As String, loadPath As String, Optional existMode As FtpLocalExists = FtpLocalExists.Overwrite) As FtpStatus
|
||||
Dim ftpstart As FtpStatus
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
|
||||
ftpstart = ftpClient.DownloadFile(loadPath, remotePath, existMode)
|
||||
ftpClient.Disconnect()
|
||||
|
||||
End Using
|
||||
Return ftpstart
|
||||
End Function
|
||||
|
||||
|
||||
Public Overloads Function FtpDownload(FtpDownloadfile As Dictionary(Of String, String), Optional flag As Boolean = False, Optional existMode As FtpLocalExists = FtpLocalExists.Overwrite) As FtpStatus
|
||||
Dim ftpstart As FtpStatus = FtpStatus.Success
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
For Each loadfile In FtpDownloadfile
|
||||
ftpstart = ftpClient.DownloadFile(loadfile.Value, loadfile.Key, existMode)
|
||||
If flag Then
|
||||
ftpstart = ftpClient.DownloadFile(loadfile.Value.Replace(".xml", ".dat"), loadfile.Key.Replace(".xml", ".dat"), existMode)
|
||||
End If
|
||||
If ftpstart = 1 Then
|
||||
Continue For
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
ftpClient.Disconnect()
|
||||
|
||||
End Using
|
||||
Return ftpstart
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 从获取FTP指定目录下的所有文件名
|
||||
''' 从FTP下载压缩包,到本地指定路径
|
||||
''' </summary>
|
||||
Public Overloads Function GeTFtpDirFilelist(remotePath As String, loadPath As String, Optional existMode As FtpLocalExists = FtpLocalExists.Overwrite) As FtpListItem()
|
||||
Dim ftpstart As FtpListItem()
|
||||
Using ftpClient As FtpClient = New FtpClient(_ftpHost, _ftpPort, _ftpUser, _ftpPwd)
|
||||
AddHandler ftpClient.ValidateCertificate, AddressOf OnValidateCertificate
|
||||
ftpClient.EncryptionMode = FtpEncryptionMode.Auto
|
||||
ftpClient.AutoConnect()
|
||||
|
||||
'ftpstart = ftpClient.DownloadFile(loadPath, remotePath, existMode)
|
||||
|
||||
ftpstart = ftpClient.GetListing()
|
||||
ftpClient.Disconnect()
|
||||
End Using
|
||||
Return ftpstart
|
||||
End Function
|
||||
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
492
FTP/blvFtpServer.vb
Normal file
492
FTP/blvFtpServer.vb
Normal file
@@ -0,0 +1,492 @@
|
||||
Imports BLV_Studio.UTSModule
|
||||
Imports deviceparsingdatalog.UTSModule
|
||||
Imports MD5Hash
|
||||
Imports System.IO
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Security.Policy
|
||||
Imports System.Text
|
||||
Imports System.Threading
|
||||
Public Class blvFtpServer
|
||||
''' <summary>
|
||||
''' 单独下载控制开关 和 separateMap 一起使用
|
||||
''' </summary>
|
||||
Public separateSart As Boolean = False
|
||||
''' <summary>
|
||||
''' 单独下载 文件集合 <云文件路径本地文件路径>
|
||||
''' </summary>
|
||||
Public separateMap As New Dictionary(Of String, String)
|
||||
'Public password As String = MD5Hash.Hash.Content("123")
|
||||
''' <summary>
|
||||
''' 文件同步线程
|
||||
''' </summary>
|
||||
Public _syn_thread As Thread
|
||||
''' <summary>
|
||||
''' 本地同步文件夹路径
|
||||
''' </summary>
|
||||
Public _SyncLoadDirPath As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据库登录
|
||||
''' </summary>
|
||||
Public _dbLoginStr As String
|
||||
''' <summary>
|
||||
''' 数据库同步文件集 所在文件夹路径 *文件名
|
||||
''' </summary>
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 需要下载的文件集 相对路径文件名
|
||||
''' </summary>
|
||||
|
||||
''' <summary>
|
||||
''' FTP同步标志
|
||||
''' </summary>
|
||||
Public _startFlag As Integer = 0
|
||||
''' <summary>
|
||||
''' FTP同步间隔
|
||||
''' </summary>
|
||||
Public num As Integer = 30
|
||||
''' <summary>
|
||||
'''
|
||||
''' </summary>
|
||||
''' <param name="loadpath">同步文件夹本地路径</param>
|
||||
''' <param name="serverpath">同步云文件夹路径</param>
|
||||
Sub New(loadpath As String, dbLoginStr As String)
|
||||
_dbLoginStr = dbLoginStr
|
||||
If loadpath.Substring(loadpath.Length - 1, 1).Equals("\") Then
|
||||
_SyncLoadDirPath = loadpath
|
||||
Else
|
||||
_SyncLoadDirPath = loadpath & "\"
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub FtpfileMain()
|
||||
|
||||
'开启线程
|
||||
FtpfileThread()
|
||||
|
||||
End Sub
|
||||
|
||||
Public Sub FtpfileDownload(dirpath As String, filename As String)
|
||||
Try
|
||||
UtsFtp.InitConnectParams(FtpPort, FtpUser, FtpPwd)
|
||||
Dim ftp As UtsFtp = UtsFtp.CreateObject()
|
||||
ftp.FtpHost = FtpHost
|
||||
'For Each filepath In _SyncToLoadFile
|
||||
|
||||
'ftp.FtpDownload("/Data/Model/485Model/3.txt", _SyncLoadDirPath & "3.txt")
|
||||
ftp.FtpDownload(dirpath, filename)
|
||||
|
||||
' Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Sub FtpfileThread()
|
||||
Dim cnt As Integer = 50
|
||||
Dim _FilePath_li As List(Of String)
|
||||
Dim loadFilerow As List(Of Dictionary(Of String, String))
|
||||
Dim FileMysqlRow As List(Of Dictionary(Of String, String))
|
||||
Dim SyncToLoadFile As Dictionary(Of String, String)
|
||||
_startFlag = 0
|
||||
While True
|
||||
|
||||
If cnt > num Then
|
||||
cnt = 0
|
||||
_startFlag = 0
|
||||
RaiseEvent updateIcon(0)
|
||||
|
||||
num = 1800
|
||||
|
||||
_FilePath_li = Enumerationdirectory(_SyncLoadDirPath)
|
||||
'本地文件信息储存
|
||||
loadFilerow = filetosqlfunction(_FilePath_li)
|
||||
' 获取数据库文件数据
|
||||
FileMysqlRow = GetMysqlfiledata(_dbLoginStr)
|
||||
' 文件比对
|
||||
SyncToLoadFile = Proofreadfile(loadFilerow, FileMysqlRow)
|
||||
' FTP下载
|
||||
FTPDownloadFile(SyncToLoadFile, FileMysqlRow)
|
||||
|
||||
FileMysqlRow.Clear()
|
||||
SyncNumber.Clear()
|
||||
SyncToLoadFile.Clear()
|
||||
|
||||
End If
|
||||
|
||||
If separateSart Then
|
||||
_startFlag = 0
|
||||
RaiseEvent updateIcon(0)
|
||||
Dim filename As String = separateMap.Keys(0)
|
||||
filename = filename.Substring(filename.LastIndexOf("\") + 1)
|
||||
filename = $" `CONFIG_XML` = '{filename}' "
|
||||
FileMysqlRow = GetMysqlfiledata(_dbLoginStr, filename)
|
||||
If FileMysqlRow.Count > 0 Then
|
||||
SyncNumber.Add(0)
|
||||
End If
|
||||
FTPDownloadFile(separateMap, FileMysqlRow.Item(0))
|
||||
FileMysqlRow.Clear()
|
||||
separateMap.Clear()
|
||||
SyncNumber.Clear()
|
||||
separateSart = False
|
||||
End If
|
||||
|
||||
cnt += 1
|
||||
Thread.Sleep(1000)
|
||||
End While
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
'''' <summary>
|
||||
'''' 获取指定文件夹下所有文件
|
||||
'''' 获取同步文件夹文件
|
||||
'''' </summary>
|
||||
'''' <param name="dirpath"></param>
|
||||
'Public Function Enumerationdirectory(dirpath As String) As List(Of String)
|
||||
' If IO.Directory.Exists(dirpath) Then
|
||||
' Dim filebufF() As String = IO.Directory.GetFiles(dirpath)
|
||||
' If filebufF.Length > 0 Then
|
||||
' _FilePath_li.AddRange(filebufF)
|
||||
' End If
|
||||
|
||||
' Dim dirbuff() As String = IO.Directory.GetDirectories(dirpath)
|
||||
' _DirPah_li.AddRange(dirbuff)
|
||||
' For Each partdir In dirbuff
|
||||
' Enumerationdirectory(partdir)
|
||||
' Next
|
||||
' Else
|
||||
' MessageBox.Show("同步文件夹不存在")
|
||||
' End If
|
||||
|
||||
'End Function
|
||||
|
||||
Public Function Enumerationdirectory(dirpath As String) As List(Of String)
|
||||
Dim filelist As New List(Of String)
|
||||
Dim dirlist As New List(Of String)
|
||||
If IO.Directory.Exists(dirpath) Then
|
||||
|
||||
Dim filebufF() As String = IO.Directory.GetFiles(dirpath)
|
||||
If filebufF.Length > 0 Then
|
||||
filelist.AddRange(filebufF)
|
||||
End If
|
||||
|
||||
Dim dirbuff() As String = IO.Directory.GetDirectories(dirpath)
|
||||
dirlist.AddRange(dirbuff)
|
||||
For Each partdir In dirbuff
|
||||
filelist.AddRange(Enumerationdirectory(partdir))
|
||||
Next
|
||||
Else
|
||||
MessageBox.Show("同步文件夹不存在")
|
||||
End If
|
||||
Return filelist
|
||||
End Function
|
||||
|
||||
|
||||
Public Function filetosqlfunction(ByRef _FilePath_li As List(Of String)) As List(Of Dictionary(Of String, String))
|
||||
Dim loadFilerow As New List(Of Dictionary(Of String, String))
|
||||
For Each filestr In _FilePath_li
|
||||
' Dim filedata As New FileToSqlVariable
|
||||
Dim clunm As New Dictionary(Of String, String)
|
||||
Dim md5 As String = GetStringMd5(filestr)
|
||||
Dim filedir As String = filestr.Substring(0, filestr.LastIndexOf("\") + 1)
|
||||
|
||||
Dim filename As String = filestr.Substring(filedir.Length, filestr.Length - filedir.Length)
|
||||
clunm.Add("Directory", filedir)
|
||||
clunm.Add("Available", 1)
|
||||
clunm.Add("FileName", filename)
|
||||
clunm.Add("UploadDateTime", Now.ToString("yyyy-MM-dd HH:mm:ss.fff"))
|
||||
clunm.Add("MD5", md5)
|
||||
loadFilerow.Add(clunm)
|
||||
'filedata_li.Add(filedata)
|
||||
Next
|
||||
_FilePath_li.Clear()
|
||||
Return loadFilerow
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 获取数据库文件数据
|
||||
''' </summary>
|
||||
''' <param name="DbConnString"></param>
|
||||
''' <returns></returns>
|
||||
|
||||
Public Function GetMysqlfiledata(DbConnString As String) As List(Of Dictionary(Of String, String))
|
||||
'Dim sqlfile As New Dictionary(Of Integer, List(Of String))
|
||||
Dim FileMysqlRow As New List(Of Dictionary(Of String, String))
|
||||
Try
|
||||
Dim dt As DataTable
|
||||
|
||||
Using db As New DbExecutor(DbExecutor.DbTypeEnum.Mysql, DbConnString)
|
||||
db.Open()
|
||||
dt = db.ExecuteDataTable(db.CmdHelper.SearchAll("tbl_model_file_data", $"Available = '1'"))
|
||||
db.Close()
|
||||
End Using
|
||||
For Each dtrow As DataRow In dt.Rows
|
||||
Dim clunm As New Dictionary(Of String, String)
|
||||
For i As Integer = 0 To dt.Columns.Count - 1
|
||||
'Console.WriteLine("argRoomTypeNodeIdx = " & dtrow.Item(i))
|
||||
'If dtrow.Item(i).GetType = "DbNull" Then
|
||||
' clunm.Add(dt.Columns(i).ColumnName, "")
|
||||
' Continue For
|
||||
'End If
|
||||
clunm.Add(dt.Columns(i).ColumnName, dtrow.Item(i).ToString)
|
||||
Next
|
||||
FileMysqlRow.Add(clunm)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Return FileMysqlRow
|
||||
End Function
|
||||
''' <summary>
|
||||
'''
|
||||
''' </summary>
|
||||
''' <param name="DbConnString"></param>
|
||||
''' <param name="where"></param>
|
||||
''' <returns></returns>
|
||||
Public Function GetMysqlfiledata(DbConnString As String, where As String) As List(Of Dictionary(Of String, String))
|
||||
'Dim sqlfile As New Dictionary(Of Integer, List(Of String))
|
||||
Dim FileMysqlRow As New List(Of Dictionary(Of String, String))
|
||||
Try
|
||||
Dim dt As DataTable
|
||||
|
||||
Using db As New DbExecutor(DbExecutor.DbTypeEnum.Mysql, DbConnString)
|
||||
db.Open()
|
||||
dt = db.ExecuteDataTable(db.CmdHelper.SearchAll("tbl_room_type_list", where))
|
||||
db.Close()
|
||||
End Using
|
||||
For Each dtrow As DataRow In dt.Rows
|
||||
Dim clunm As New Dictionary(Of String, String)
|
||||
For i As Integer = 0 To dt.Columns.Count - 1
|
||||
'Console.WriteLine("argRoomTypeNodeIdx = " & dtrow.Item(i))
|
||||
'If dtrow.Item(i).GetType = "DbNull" Then
|
||||
' clunm.Add(dt.Columns(i).ColumnName, "")
|
||||
' Continue For
|
||||
'End If
|
||||
clunm.Add(dt.Columns(i).ColumnName, dtrow.Item(i).ToString)
|
||||
Next
|
||||
FileMysqlRow.Add(clunm)
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
Return FileMysqlRow
|
||||
End Function
|
||||
Public SyncNumber As New List(Of Integer)
|
||||
''' <summary>
|
||||
''' 文件比对
|
||||
''' </summary>
|
||||
Public Function Proofreadfile(ByRef loadFilerow As List(Of Dictionary(Of String, String)), ByRef FileMysqlRow As List(Of Dictionary(Of String, String)))
|
||||
'下载标记 False 下载
|
||||
Dim SyncToLoadFile As New Dictionary(Of String, String)
|
||||
For i As Integer = 0 To FileMysqlRow.Count - 1
|
||||
Dim download_flag As Boolean = False
|
||||
Dim serverRow As Dictionary(Of String, String) = FileMysqlRow.Item(i)
|
||||
For j As Integer = 0 To loadFilerow.Count - 1
|
||||
Dim loadRow As Dictionary(Of String, String) = loadFilerow.Item(j)
|
||||
If Filecomparison(serverRow, loadRow) Then
|
||||
loadFilerow.RemoveAt(j)
|
||||
download_flag = True
|
||||
Exit For
|
||||
Else
|
||||
download_flag = False
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Next
|
||||
|
||||
|
||||
If download_flag Then
|
||||
Continue For
|
||||
Else
|
||||
'Dim syncfile As New Dictionary(Of String, String)
|
||||
''云文件完整路径
|
||||
'Dim Syncpath = _FileMysqlRow.Item(i).Item("Directory") & "\" & _FileMysqlRow.Item(i).Item("FileName")
|
||||
'云文件相对路径
|
||||
Dim filepath = FileMysqlRow.Item(i).Item("Directory") & "\" & FileMysqlRow.Item(i).Item("XML_FileName")
|
||||
'syncfile.Add(Syncpath, RelativePath)
|
||||
Dim Loadfilepath As String = filepath.Replace("\Data\Model\", "")
|
||||
SyncNumber.Add(i) '储存节点,便于枚举云MD5值
|
||||
SyncToLoadFile.Add(filepath, _SyncLoadDirPath & Loadfilepath)
|
||||
|
||||
End If
|
||||
|
||||
Next
|
||||
loadFilerow.Clear()
|
||||
|
||||
Return SyncToLoadFile
|
||||
End Function
|
||||
|
||||
Public Function Filecomparison(sqlfile As Dictionary(Of String, String), loadfile As Dictionary(Of String, String)) As Boolean
|
||||
|
||||
Dim loadpath = loadfile.Item("Directory").Replace(_SyncLoadDirPath, "_\") & loadfile.Item("FileName")
|
||||
Dim serverpath = sqlfile.Item("Directory").Replace("\Data\Model", "_") & "\" & sqlfile.Item("XML_FileName")
|
||||
|
||||
If loadpath.Equals(serverpath) AndAlso loadfile.Item("MD5").Equals(sqlfile.Item("XLM_MD5")) Then
|
||||
Return True
|
||||
End If
|
||||
Return False
|
||||
End Function
|
||||
Public FtpHost As String = "blv-oa.com"
|
||||
Public FtpPort As Integer = 50
|
||||
Public FtpUser As String = "BLV_Studio"
|
||||
Public FtpPwd As String = "37f5675t6R&5*"
|
||||
''' <summary>
|
||||
''' FTP下载
|
||||
''' </summary>
|
||||
Public Sub FTPDownloadFile(SyncToLoadFile As Dictionary(Of String, String), dic As Dictionary(Of String, String))
|
||||
Try
|
||||
UtsFtp.InitConnectParams(FtpPort, FtpUser, FtpPwd)
|
||||
Dim ftp As UtsFtp = UtsFtp.CreateObject()
|
||||
ftp.FtpHost = FtpHost
|
||||
'For Each filepath In _SyncToLoadFile
|
||||
|
||||
'ftp.FtpDownload("/Data/Model/485Model/3.txt", _SyncLoadDirPath & "3.txt")
|
||||
If ftp.FtpDownload(SyncToLoadFile, True) = 1 Then
|
||||
If VerifyFileMD5(SyncToLoadFile.Values(0), dic.Item("CONFIG_XML_MD5")) Then
|
||||
If VerifyFileMD5(SyncToLoadFile.Values(0), dic.Item("CONFIG_BIN_MD5")) Then
|
||||
Else
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
End If
|
||||
Else
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
End If
|
||||
Else
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
'检验文件是否下载到本地,和确保下载的文件是数据库的文件
|
||||
|
||||
|
||||
|
||||
_startFlag = 2
|
||||
num = 3600
|
||||
RaiseEvent updateIcon(2)
|
||||
|
||||
Catch ex As Exception
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
'AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Public Sub FTPDownloadFile(SyncToLoadFile As Dictionary(Of String, String), FileMysqlRow As List(Of Dictionary(Of String, String)))
|
||||
Try
|
||||
UtsFtp.InitConnectParams(FtpPort, FtpUser, FtpPwd)
|
||||
Dim ftp As UtsFtp = UtsFtp.CreateObject()
|
||||
ftp.FtpHost = FtpHost
|
||||
'For Each filepath In _SyncToLoadFile
|
||||
If SyncToLoadFile.Count = 0 Then
|
||||
_startFlag = 2
|
||||
num = 3600
|
||||
RaiseEvent updateIcon(2)
|
||||
Return
|
||||
End If
|
||||
'ftp.FtpDownload("/Data/Model/485Model/3.txt", _SyncLoadDirPath & "3.txt")
|
||||
If ftp.FtpDownload(SyncToLoadFile) = 1 Then
|
||||
For i As Integer = 0 To SyncToLoadFile.Count - 1
|
||||
'检验文件是否下载到本地,和确保下载的文件是数据库的文件
|
||||
If VerifyFileMD5(SyncToLoadFile.Values(i), FileMysqlRow.Item(SyncNumber.Item(i)).Item("XLM_MD5")) Then
|
||||
|
||||
Else
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
End If
|
||||
Next
|
||||
Else
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
End If
|
||||
|
||||
|
||||
|
||||
|
||||
_startFlag = 2
|
||||
num = 3600
|
||||
RaiseEvent updateIcon(2)
|
||||
|
||||
Catch ex As Exception
|
||||
_startFlag = 1
|
||||
num = 600
|
||||
RaiseEvent updateIcon(1)
|
||||
Return
|
||||
'AdminLog.ApplicationLog.WriteErrorLog(ex)
|
||||
|
||||
End Try
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function VerifyFileMD5(filePath As String, fileMd5 As String) As Boolean
|
||||
|
||||
If IO.File.Exists(filePath) Then
|
||||
Dim loadMD5 As String = GetStringMd5(filePath)
|
||||
fileMd5 = fileMd5.ToUpper
|
||||
loadMD5 = loadMD5.ToUpper
|
||||
If fileMd5.Equals(loadMD5) Then
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Public Function GetStringMd5(filePath As String) As String
|
||||
Dim dataFile() As Byte = File.ReadAllBytes(filePath)
|
||||
|
||||
Dim databuff As Byte() = MD5.Create().ComputeHash(dataFile)
|
||||
Dim MD5str As String = BitConverter.ToString(databuff)
|
||||
Return MD5str.Replace("-", "")
|
||||
'Console.WriteLine($"md5-1:{MD5str.Replace("-", "")}")
|
||||
End Function
|
||||
|
||||
Public Function Utf8ToGB2312(utf8str As String) As String
|
||||
Dim temp() As Byte
|
||||
temp = Text.Encoding.Default.GetBytes(utf8str)
|
||||
Text.Encoding.Convert(Text.Encoding.GetEncoding("utf-8"), Text.Encoding.GetEncoding("gb2312"), temp)
|
||||
Return Text.Encoding.Default.GetString(temp)
|
||||
End Function
|
||||
|
||||
Public Event updateIcon(ftpflag As Integer)
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1279
Form1.Designer.vb
generated
Normal file
1279
Form1.Designer.vb
generated
Normal file
File diff suppressed because it is too large
Load Diff
266
Form1.resx
Normal file
266
Form1.resx
Normal file
@@ -0,0 +1,266 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>188, 17</value>
|
||||
</metadata>
|
||||
<metadata name="ToolStrip2.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>300, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="ToolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="ToolStripButton7.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="ToolStripButton3.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="ToolStripButton2.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="ToolStripButton6.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="ToolStripButton4.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="ToolStripButton8.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="FastLine1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>524, 17</value>
|
||||
</metadata>
|
||||
<data name="resource.CustomPointPos" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFFTeXN0ZW0uRHJhd2luZywgVmVyc2lvbj00LjAuMC4wLCBDdWx0
|
||||
dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWIwM2Y1ZjdmMTFkNTBhM2EFAQAAABVTeXN0ZW0uRHJh
|
||||
d2luZy5Qb2ludEYCAAAAAXgBeQAACwsCAAAAAAAAAAAAAAAL
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="ToolStrip3.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>412, 17</value>
|
||||
</metadata>
|
||||
<data name="ToolStripButton5.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIDSURBVDhPpZLrS5NhGMb3j4SWh0oRQVExD4gonkDpg4hG
|
||||
YKxG6WBogkMZKgPNCEVJFBGdGETEvgwyO9DJE5syZw3PIlPEE9pgBCLZ5XvdMB8Ew8gXbl54nuf63dd9
|
||||
0OGSnwCahxbPRNPAPMw9Xpg6ZmF46kZZ0xSKzJPIrhpDWsVnpBhGkKx3nAX8Pv7z1zg8OoY/cITdn4fw
|
||||
bf/C0kYAN3Ma/w3gWfZL5kzTKBxjWyK2DftwI9tyMYCZKXbNHaD91bLYJrDXsYbrWfUKwJrPE9M2M1Oc
|
||||
VzOOpHI7Jr376Hi9ogHqFIANO0/MmmmbmSmm9a8ze+I4MrNWAdjtoJgWcx+PSzg166yZZ8xM8XvXDix9
|
||||
c4jIqFYAjoriBV9AhEPv1mH/sonogha0afbZMMZz+yreTGyhpusHwtNNCsA5U1zS4BLxzJIfg299qO32
|
||||
Ir7UJtZfftyATqeT+8o2D8JSjQrAJblrncYL7ZJ2+bfaFnC/1S1NjL3diRat7qrO7wLRP3HjWsojBeCo
|
||||
mDEo5mNjuweFGvjWg2EBhCbpkW78htSHHwRyNdmgAFzPEee2iFkzayy2OLXzT4gr6UdUnlXrullsxxQ+
|
||||
kx0g8BTA3aZlButjSTyjODq/WcQcW/B/Je4OQhLvKQDnzN1mp0nnkvAhR8VuMzNrpm1mpjgkoVwB/v8D
|
||||
TgDQASA1MVpwzwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="MySqlDataAdapter1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>42</value>
|
||||
</metadata>
|
||||
</root>
|
||||
80
Form2.Designer.vb
generated
Normal file
80
Form2.Designer.vb
generated
Normal file
@@ -0,0 +1,80 @@
|
||||
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
|
||||
Partial Class Form2
|
||||
Inherits System.Windows.Forms.Form
|
||||
|
||||
'Form 重写 Dispose,以清理组件列表。
|
||||
<System.Diagnostics.DebuggerNonUserCode()> _
|
||||
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
|
||||
Try
|
||||
If disposing AndAlso components IsNot Nothing Then
|
||||
components.Dispose()
|
||||
End If
|
||||
Finally
|
||||
MyBase.Dispose(disposing)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'Windows 窗体设计器所必需的
|
||||
Private components As System.ComponentModel.IContainer
|
||||
|
||||
'注意: 以下过程是 Windows 窗体设计器所必需的
|
||||
'可以使用 Windows 窗体设计器修改它。
|
||||
'不要使用代码编辑器修改它。
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.TabControl1 = New System.Windows.Forms.TabControl()
|
||||
Me.TabPage1 = New System.Windows.Forms.TabPage()
|
||||
Me.TabPage2 = New System.Windows.Forms.TabPage()
|
||||
Me.TabControl1.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'TabControl1
|
||||
'
|
||||
Me.TabControl1.Controls.Add(Me.TabPage1)
|
||||
Me.TabControl1.Controls.Add(Me.TabPage2)
|
||||
Me.TabControl1.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.TabControl1.ItemSize = New System.Drawing.Size(60, 1)
|
||||
Me.TabControl1.Location = New System.Drawing.Point(0, 0)
|
||||
Me.TabControl1.Name = "TabControl1"
|
||||
Me.TabControl1.SelectedIndex = 0
|
||||
Me.TabControl1.Size = New System.Drawing.Size(800, 450)
|
||||
Me.TabControl1.TabIndex = 0
|
||||
'
|
||||
'TabPage1
|
||||
'
|
||||
Me.TabPage1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None
|
||||
Me.TabPage1.Location = New System.Drawing.Point(4, 5)
|
||||
Me.TabPage1.Name = "TabPage1"
|
||||
Me.TabPage1.Padding = New System.Windows.Forms.Padding(3)
|
||||
Me.TabPage1.Size = New System.Drawing.Size(792, 441)
|
||||
Me.TabPage1.TabIndex = 0
|
||||
Me.TabPage1.Text = "TabPage1"
|
||||
Me.TabPage1.UseVisualStyleBackColor = True
|
||||
'
|
||||
'TabPage2
|
||||
'
|
||||
Me.TabPage2.Location = New System.Drawing.Point(4, 22)
|
||||
Me.TabPage2.Name = "TabPage2"
|
||||
Me.TabPage2.Padding = New System.Windows.Forms.Padding(3)
|
||||
Me.TabPage2.Size = New System.Drawing.Size(792, 424)
|
||||
Me.TabPage2.TabIndex = 1
|
||||
Me.TabPage2.Text = "TabPage2"
|
||||
Me.TabPage2.UseVisualStyleBackColor = True
|
||||
'
|
||||
'Form2
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(800, 450)
|
||||
Me.Controls.Add(Me.TabControl1)
|
||||
Me.Name = "Form2"
|
||||
Me.Text = "Form2"
|
||||
Me.TabControl1.ResumeLayout(False)
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
|
||||
Friend WithEvents TabControl1 As TabControl
|
||||
Friend WithEvents TabPage1 As TabPage
|
||||
Friend WithEvents TabPage2 As TabPage
|
||||
End Class
|
||||
120
Form2.resx
Normal file
120
Form2.resx
Normal file
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
17
Form2.vb
Normal file
17
Form2.vb
Normal file
@@ -0,0 +1,17 @@
|
||||
Public Class Form2
|
||||
|
||||
|
||||
Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
'Dim f As Form1 = Form1
|
||||
|
||||
|
||||
'f.Parent = TabControl1
|
||||
|
||||
'f.Show()
|
||||
|
||||
End Sub
|
||||
|
||||
Private Sub TabPage1_Click(sender As Object, e As EventArgs) Handles TabPage1.Click
|
||||
TabPage1.SuspendLayout()
|
||||
End Sub
|
||||
End Class
|
||||
8
MssqlCmdHelper.vb
Normal file
8
MssqlCmdHelper.vb
Normal file
@@ -0,0 +1,8 @@
|
||||
Public Class MssqlCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "["c
|
||||
FiledPrefix = "]"c
|
||||
End Sub
|
||||
End Class
|
||||
38
My Project/Application.Designer.vb
generated
Normal file
38
My Project/Application.Designer.vb
generated
Normal file
@@ -0,0 +1,38 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 此代码由工具生成。
|
||||
' 运行时版本:4.0.30319.42000
|
||||
'
|
||||
' 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
' 重新生成代码,这些更改将会丢失。
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
'注意:此文件是自动生成的;请勿直接进行修改。若要更改,
|
||||
' 或者如果您在此文件中遇到生成错误,请转至项目设计器
|
||||
' (转至“项目属性”或在解决方案资源管理器中双击“我的项目”节点),
|
||||
' 然后在“应用程序”选项卡中进行更改。
|
||||
'
|
||||
Partial Friend Class MyApplication
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Public Sub New()
|
||||
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
|
||||
Me.IsSingleInstance = false
|
||||
Me.EnableVisualStyles = true
|
||||
Me.SaveMySettingsOnExit = true
|
||||
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
|
||||
End Sub
|
||||
|
||||
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
|
||||
Protected Overrides Sub OnCreateMainForm()
|
||||
Me.MainForm = Global.deviceparsingdatalog.Form1
|
||||
End Sub
|
||||
End Class
|
||||
End Namespace
|
||||
10
My Project/Application.myapp
Normal file
10
My Project/Application.myapp
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
||||
<MySubMain>true</MySubMain>
|
||||
<MainForm>Form1</MainForm>
|
||||
<SingleInstance>false</SingleInstance>
|
||||
<ShutdownMode>0</ShutdownMode>
|
||||
<EnableVisualStyles>true</EnableVisualStyles>
|
||||
<AuthenticationMode>0</AuthenticationMode>
|
||||
<SaveMySettingsOnExit>true</SaveMySettingsOnExit>
|
||||
</MyApplicationData>
|
||||
35
My Project/AssemblyInfo.vb
Normal file
35
My Project/AssemblyInfo.vb
Normal file
@@ -0,0 +1,35 @@
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
Imports System.Runtime.InteropServices
|
||||
|
||||
' 有关程序集的一般信息由以下
|
||||
' 控制。更改这些特性值可修改
|
||||
' 与程序集关联的信息。
|
||||
|
||||
'查看程序集特性的值
|
||||
|
||||
<Assembly: AssemblyTitle("DataPresentationManager")>
|
||||
<Assembly: AssemblyDescription("")>
|
||||
<Assembly: AssemblyCompany("")>
|
||||
<Assembly: AssemblyProduct("DataPresentationManager")>
|
||||
<Assembly: AssemblyCopyright("Copyright © 2024")>
|
||||
<Assembly: AssemblyTrademark("")>
|
||||
|
||||
<Assembly: ComVisible(False)>
|
||||
|
||||
'如果此项目向 COM 公开,则下列 GUID 用于 typelib 的 ID
|
||||
<Assembly: Guid("bbb82722-9bae-4ca6-8f10-8da5c8a591c1")>
|
||||
|
||||
' 程序集的版本信息由下列四个值组成:
|
||||
'
|
||||
' 主版本
|
||||
' 次版本
|
||||
' 生成号
|
||||
' 修订号
|
||||
'
|
||||
'可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
'通过使用 "*",如下所示:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("1.0.0.5")>
|
||||
<Assembly: AssemblyFileVersion("1.0.0.5")>
|
||||
63
My Project/Resources.Designer.vb
generated
Normal file
63
My Project/Resources.Designer.vb
generated
Normal file
@@ -0,0 +1,63 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 此代码由工具生成。
|
||||
' 运行时版本:4.0.30319.42000
|
||||
'
|
||||
' 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
' 重新生成代码,这些更改将会丢失。
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
|
||||
Namespace My.Resources
|
||||
|
||||
'此类是由 StronglyTypedResourceBuilder
|
||||
'类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
|
||||
'若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
|
||||
'(以 /str 作为命令选项),或重新生成 VS 项目。
|
||||
'''<summary>
|
||||
''' 一个强类型的资源类,用于查找本地化的字符串等。
|
||||
'''</summary>
|
||||
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
|
||||
Friend Module Resources
|
||||
|
||||
Private resourceMan As Global.System.Resources.ResourceManager
|
||||
|
||||
Private resourceCulture As Global.System.Globalization.CultureInfo
|
||||
|
||||
'''<summary>
|
||||
''' 返回此类使用的缓存的 ResourceManager 实例。
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
|
||||
Get
|
||||
If Object.ReferenceEquals(resourceMan, Nothing) Then
|
||||
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("deviceparsingdatalog.Resources", GetType(Resources).Assembly)
|
||||
resourceMan = temp
|
||||
End If
|
||||
Return resourceMan
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' 重写当前线程的 CurrentUICulture 属性,对
|
||||
''' 使用此强类型资源类的所有资源查找执行重写。
|
||||
'''</summary>
|
||||
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Friend Property Culture() As Global.System.Globalization.CultureInfo
|
||||
Get
|
||||
Return resourceCulture
|
||||
End Get
|
||||
Set
|
||||
resourceCulture = value
|
||||
End Set
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
117
My Project/Resources.resx
Normal file
117
My Project/Resources.resx
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
97
My Project/Settings.Designer.vb
generated
Normal file
97
My Project/Settings.Designer.vb
generated
Normal file
@@ -0,0 +1,97 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' 此代码由工具生成。
|
||||
' 运行时版本:4.0.30319.42000
|
||||
'
|
||||
' 对此文件的更改可能会导致不正确的行为,并且如果
|
||||
' 重新生成代码,这些更改将会丢失。
|
||||
' </auto-generated>
|
||||
'------------------------------------------------------------------------------
|
||||
|
||||
Option Strict On
|
||||
Option Explicit On
|
||||
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0"), _
|
||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
|
||||
Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings()),MySettings)
|
||||
|
||||
#Region "My.Settings 自动保存功能"
|
||||
#If _MyType = "WindowsForms" Then
|
||||
Private Shared addedHandler As Boolean
|
||||
|
||||
Private Shared addedHandlerLockObject As New Object
|
||||
|
||||
<Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||
Private Shared Sub AutoSaveSettings(sender As Global.System.Object, e As Global.System.EventArgs)
|
||||
If My.Application.SaveMySettingsOnExit Then
|
||||
My.Settings.Save()
|
||||
End If
|
||||
End Sub
|
||||
#End If
|
||||
#End Region
|
||||
|
||||
Public Shared ReadOnly Property [Default]() As MySettings
|
||||
Get
|
||||
|
||||
#If _MyType = "WindowsForms" Then
|
||||
If Not addedHandler Then
|
||||
SyncLock addedHandlerLockObject
|
||||
If Not addedHandler Then
|
||||
AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
|
||||
addedHandler = True
|
||||
End If
|
||||
End SyncLock
|
||||
End If
|
||||
#End If
|
||||
Return defaultInstance
|
||||
End Get
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public Property FileDir() As String
|
||||
Get
|
||||
Return CType(Me("FileDir"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("FileDir") = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
Public Property fastLineName() As String
|
||||
Get
|
||||
Return CType(Me("fastLineName"),String)
|
||||
End Get
|
||||
Set
|
||||
Me("fastLineName") = value
|
||||
End Set
|
||||
End Property
|
||||
End Class
|
||||
End Namespace
|
||||
|
||||
Namespace My
|
||||
|
||||
<Global.Microsoft.VisualBasic.HideModuleNameAttribute(), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()> _
|
||||
Friend Module MySettingsProperty
|
||||
|
||||
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")> _
|
||||
Friend ReadOnly Property Settings() As Global.deviceparsingdatalog.My.MySettings
|
||||
Get
|
||||
Return Global.deviceparsingdatalog.My.MySettings.Default
|
||||
End Get
|
||||
End Property
|
||||
End Module
|
||||
End Namespace
|
||||
12
My Project/Settings.settings
Normal file
12
My Project/Settings.settings
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="FileDir" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
<Setting Name="fastLineName" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
9
MysqlCmdHelper.vb
Normal file
9
MysqlCmdHelper.vb
Normal file
@@ -0,0 +1,9 @@
|
||||
Public Class MysqlCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "`"c
|
||||
FiledPrefix = "`"c
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
11
MysqlDataDispose.vb
Normal file
11
MysqlDataDispose.vb
Normal file
@@ -0,0 +1,11 @@
|
||||
Public Class MysqlDataDispose
|
||||
|
||||
Sub New()
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
|
||||
End Class
|
||||
220
MysqlDataParam.vb
Normal file
220
MysqlDataParam.vb
Normal file
@@ -0,0 +1,220 @@
|
||||
Imports System.Text
|
||||
|
||||
Public Class MysqlDataParam
|
||||
Enum DataTypeEnum
|
||||
'###############################数值类型#############################
|
||||
''' <summary>
|
||||
''' 1 byte,小整数值
|
||||
''' </summary>
|
||||
Tinyint
|
||||
|
||||
''' <summary>
|
||||
''' 2 bytes,大整数值
|
||||
''' </summary>
|
||||
Smallint
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,大整数值
|
||||
''' </summary>
|
||||
Mediumint
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,大整数值
|
||||
''' </summary>
|
||||
Int
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,大整数值
|
||||
''' </summary>
|
||||
[Integer]
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,极大整数值
|
||||
''' </summary>
|
||||
Bigint
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,单精度浮点数值
|
||||
''' </summary>
|
||||
Float
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,双精度浮点数值
|
||||
''' </summary>
|
||||
[Double]
|
||||
|
||||
|
||||
|
||||
'####################日期类型###############################
|
||||
|
||||
''' <summary>
|
||||
''' 对DECIMAL(M,D) ,如果M>D,为M+2否则为D+2.小数值
|
||||
''' </summary>
|
||||
[Decimal]
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,日期值,YYYY-MM-DD
|
||||
''' </summary>
|
||||
[Date]
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 3 bytes,时间值或持续时间,HH:MM:SS
|
||||
''' </summary>
|
||||
Time
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 1 bytes,年份值,YYYY
|
||||
''' </summary>
|
||||
Year
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 8 bytes,混合日期和时间值,YYYY-MM-DD HH:MM:SS
|
||||
''' </summary>
|
||||
Datetime
|
||||
|
||||
''' <summary>
|
||||
''' 4 bytes,混合日期和时间值,时间戳,YYYYMMDD HHMMSS
|
||||
''' </summary>
|
||||
Timestamp
|
||||
|
||||
|
||||
'####################字符类型###############################
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,定长字符串
|
||||
''' </summary>
|
||||
[Char]
|
||||
|
||||
''' <summary>
|
||||
''' 0-65535 bytes,变长字符串
|
||||
''' </summary>
|
||||
Varchar
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,不超过 255 个字符的二进制字符串
|
||||
''' </summary>
|
||||
Tinyblob
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 0-255 bytes,短文本字符串
|
||||
''' </summary>
|
||||
Tinytext
|
||||
|
||||
''' <summary>
|
||||
''' 0-65 535 bytes,二进制形式的长文本数据
|
||||
''' </summary>
|
||||
Blob
|
||||
|
||||
''' <summary>
|
||||
''' 0-65 535 bytes,长文本数据
|
||||
''' </summary>
|
||||
Text
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 0-16 777 215 bytes,二进制形式的中等长度文本数据
|
||||
''' </summary>
|
||||
Mediumblob
|
||||
|
||||
''' <summary>
|
||||
''' 0-16 777 215 bytes,中等长度文本数据
|
||||
''' </summary>
|
||||
Mediumtext
|
||||
|
||||
''' <summary>
|
||||
''' 0-4 294 967 295 bytes,二进制形式的极大文本数据
|
||||
''' </summary>
|
||||
Longblob
|
||||
|
||||
''' <summary>
|
||||
''' 0-4 294 967 295 bytes,极大文本数据
|
||||
''' </summary>
|
||||
Longtext
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As DataTypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型是否带符号
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsUnsigned() As Boolean
|
||||
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case DataTypeEnum.Varchar, DataTypeEnum.[Char]
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case DataTypeEnum.Int
|
||||
sb.Append($" {DataType}")
|
||||
If IsUnsigned Then sb.Append($" Unsigned")
|
||||
If IsAutoIncrement Then sb.Append($" AUTO_INCREMENT")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
1269
NetworkData.vb
Normal file
1269
NetworkData.vb
Normal file
File diff suppressed because it is too large
Load Diff
21
SqliteCmdHelper.vb
Normal file
21
SqliteCmdHelper.vb
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
Public Class SqliteCmdHelper
|
||||
Inherits DbCmdHelper
|
||||
|
||||
Sub New()
|
||||
FiledSuffix = "["c
|
||||
FiledPrefix = "]"c
|
||||
End Sub
|
||||
|
||||
''' <summary>
|
||||
''' 查询指定数据表的信息
|
||||
''' </summary>
|
||||
''' <param name="tableName"></param>
|
||||
''' <returns></returns>
|
||||
Public Overrides Function SearchTableInfo(tableName As String) As String
|
||||
Return $"select * from sqlite_master where tbl_name = '{tableName}';"
|
||||
End Function
|
||||
Imports System.Data.SQLite
|
||||
|
||||
|
||||
End Class
|
||||
105
SqliteDataParam.vb
Normal file
105
SqliteDataParam.vb
Normal file
@@ -0,0 +1,105 @@
|
||||
Imports System.Text
|
||||
|
||||
|
||||
Public Class SqliteDataParam
|
||||
Enum DataTypeEnum
|
||||
Varchar
|
||||
Nchar
|
||||
Blob
|
||||
Bit
|
||||
Datetime
|
||||
[Decimal]
|
||||
Real
|
||||
UniqueIdentifier
|
||||
Int
|
||||
[Integer]
|
||||
TinyInt
|
||||
[Single]
|
||||
Nvarchar
|
||||
SmallInt
|
||||
SmallUint
|
||||
Uint
|
||||
UnsignedInteger
|
||||
End Enum
|
||||
|
||||
''' <summary>
|
||||
''' 列名
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property ColumnName() As String
|
||||
|
||||
''' <summary>
|
||||
''' 当前值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property Value() As String
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 默认值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DefaultValue() As String
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataType() As DataTypeEnum
|
||||
|
||||
''' <summary>
|
||||
''' 数据类型长度
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property DataTypeLength() As Integer
|
||||
|
||||
|
||||
''' <summary>
|
||||
''' 是否允许为空
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsNull() As Boolean = True
|
||||
|
||||
''' <summary>
|
||||
''' 是否自动增长
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsAutoIncrement() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为主键
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsPrimaryKey() As Boolean
|
||||
|
||||
''' <summary>
|
||||
''' 是否为唯一值
|
||||
''' </summary>
|
||||
''' <returns></returns>
|
||||
Public Property IsUnique() As Boolean
|
||||
|
||||
|
||||
Public Function ToAddColString() As String
|
||||
Dim sb As New StringBuilder
|
||||
sb.Append($"`{ColumnName}`")
|
||||
|
||||
Select Case DataType
|
||||
Case DataTypeEnum.Varchar, DataTypeEnum.Nchar, DataTypeEnum.Nvarchar
|
||||
sb.Append($" {DataType}({DataTypeLength}) ")
|
||||
Case DataTypeEnum.Int, DataTypeEnum.Integer
|
||||
sb.Append($" {DataType}")
|
||||
Case Else
|
||||
sb.Append($" {DataType}")
|
||||
End Select
|
||||
|
||||
If IsAutoIncrement Then sb.Append($" AUTOINCREMENT")
|
||||
|
||||
sb.Append(IIf(IsNull, " Default Null", " Not Null"))
|
||||
|
||||
If IsPrimaryKey Then
|
||||
sb.Append($" PRIMARY KEY")
|
||||
End If
|
||||
|
||||
Return sb.ToString()
|
||||
End Function
|
||||
End Class
|
||||
BIN
System.Data.SQLite.dll
Normal file
BIN
System.Data.SQLite.dll
Normal file
Binary file not shown.
262
deviceparsingdatalog.vbproj
Normal file
262
deviceparsingdatalog.vbproj
Normal file
@@ -0,0 +1,262 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{2A8EB503-36FA-421A-A4A5-1B926E048EC4}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<StartupObject>deviceparsingdatalog.My.MyApplication</StartupObject>
|
||||
<RootNamespace>deviceparsingdatalog</RootNamespace>
|
||||
<AssemblyName>deviceparsingdatalog</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<MyType>WindowsForms</MyType>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<DefineDebug>true</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DocumentationFile>deviceparsingdatalog.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<DefineDebug>false</DefineDebug>
|
||||
<DefineTrace>true</DefineTrace>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DocumentationFile>deviceparsingdatalog.xml</DocumentationFile>
|
||||
<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionExplicit>On</OptionExplicit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionCompare>Binary</OptionCompare>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionStrict>Off</OptionStrict>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<OptionInfer>On</OptionInfer>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.9.0.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Portable.BouncyCastle.1.9.0\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||
<HintPath>packages\BouncyCastle.Cryptography.2.2.1\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FlexCell, Version=4.4.5.0, Culture=neutral, PublicKeyToken=6f86587eb70ee309, processorArchitecture=MSIL" />
|
||||
<Reference Include="FluentFTP, Version=33.0.3.0, Culture=neutral, PublicKeyToken=f4af092b1d8df44f, processorArchitecture=MSIL">
|
||||
<HintPath>packages\FluentFTP.33.0.3\lib\net45\FluentFTP.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf, Version=3.21.9.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Google.Protobuf.3.21.9\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.2.16.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\K4os.Compression.LZ4.1.2.16\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.2.16.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\K4os.Compression.LZ4.Streams.1.2.16\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.7.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>packages\K4os.Hash.xxHash.1.0.7\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=8.0.32.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MySql.Data.8.0.32.1\lib\net48\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Configuration.ConfigurationManager, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Configuration.ConfigurationManager.4.4.1\lib\net461\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Configuration.Install" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Data.SQLite, Version=1.0.115.5, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\Project\UTS_Studio\src-2023-03-15(Zima)\packages\System.Data.SQLite.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Diagnostics.DiagnosticSource, Version=5.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Diagnostics.DiagnosticSource.5.0.1\lib\net46\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Forms.DataVisualization" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="TeeChart, Version=4.1.2017.2153, Culture=neutral, PublicKeyToken=9c8126276c77bdb7, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\Project\UTS_Studio\src\AUTS_Studio\bin\Debug\TeeChart.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ZstdSharp, Version=0.7.1.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
|
||||
<HintPath>packages\ZstdSharp.Port.0.7.1\lib\net461\ZstdSharp.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Import Include="Microsoft.VisualBasic" />
|
||||
<Import Include="System" />
|
||||
<Import Include="System.Collections" />
|
||||
<Import Include="System.Collections.Generic" />
|
||||
<Import Include="System.Data" />
|
||||
<Import Include="System.Drawing" />
|
||||
<Import Include="System.Diagnostics" />
|
||||
<Import Include="System.Windows.Forms" />
|
||||
<Import Include="System.Linq" />
|
||||
<Import Include="System.Xml.Linq" />
|
||||
<Import Include="System.Threading.Tasks" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ApplicationLog.vb" />
|
||||
<Compile Include="C5_MUSIC.Designer.vb" />
|
||||
<Compile Include="C5_MUSIC.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CS_IO_Type.designer.vb">
|
||||
<DependentUpon>CS_IO_Type.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CS_IO_Type.vb" />
|
||||
<Compile Include="Database\Base\ColumnSchema.vb" />
|
||||
<Compile Include="Database\Base\CommandHelpers.vb" />
|
||||
<Compile Include="Database\Base\DatabaseData.vb" />
|
||||
<Compile Include="Database\Base\DatabaseSchema.vb" />
|
||||
<Compile Include="Database\Base\ForeignKeySchema.vb" />
|
||||
<Compile Include="Database\Base\IndexSchema.vb" />
|
||||
<Compile Include="Database\Base\InsertParams.vb" />
|
||||
<Compile Include="Database\Base\SearchCondition.vb" />
|
||||
<Compile Include="Database\Base\SearchParams.vb" />
|
||||
<Compile Include="Database\Base\TableSchema.vb" />
|
||||
<Compile Include="Database\Base\TriggerBuilder.vb" />
|
||||
<Compile Include="Database\Base\TriggerSchema.vb" />
|
||||
<Compile Include="Database\Base\ViewSchema.vb" />
|
||||
<Compile Include="Database\DbCmdHelper.vb" />
|
||||
<Compile Include="Database\DbExecutor.vb" />
|
||||
<Compile Include="Database\MssqlCmdHelper.vb" />
|
||||
<Compile Include="Database\Mssql\MssqlCmdHelper.vb" />
|
||||
<Compile Include="Database\MysqlCmdHelper.vb" />
|
||||
<Compile Include="Database\MysqlDataParam.vb" />
|
||||
<Compile Include="Database\Mysql\DataParam.vb" />
|
||||
<Compile Include="Database\Mysql\MysqlCmdHelper.vb" />
|
||||
<Compile Include="Database\SqliteCmdHelper.vb" />
|
||||
<Compile Include="Database\SqliteDataParam.vb" />
|
||||
<Compile Include="Database\Sqlite\DataParam.vb" />
|
||||
<Compile Include="Database\Sqlite\SqliteCmdHelper.vb" />
|
||||
<Compile Include="DataTypes.vb" />
|
||||
<Compile Include="Form1.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form1.Designer.vb">
|
||||
<DependentUpon>Form1.vb</DependentUpon>
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Form2.Designer.vb">
|
||||
<DependentUpon>Form2.vb</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Form2.vb">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="FTP\blvFtpServer.vb" />
|
||||
<Compile Include="FTP\UtsFtp.vb" />
|
||||
<Compile Include="HttpMothod.vb" />
|
||||
<Compile Include="LoginReturn.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Application.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Application.myapp</DependentUpon>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Resources.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="NetworkData.vb" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="C5_MUSIC.resx" />
|
||||
<EmbeddedResource Include="CS_IO_Type.resx">
|
||||
<DependentUpon>CS_IO_Type.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form1.resx">
|
||||
<DependentUpon>Form1.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Form2.resx">
|
||||
<DependentUpon>Form2.vb</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="My Project\Resources.resx">
|
||||
<Generator>VbMyResourcesResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.vb</LastGenOutput>
|
||||
<CustomToolNamespace>My.Resources</CustomToolNamespace>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".vs\.editorconfig" />
|
||||
<None Include="bin\.editorconfig" />
|
||||
<None Include="My Project\Application.myapp">
|
||||
<Generator>MyApplicationCodeGenerator</Generator>
|
||||
<LastGenOutput>Application.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="My Project\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<CustomToolNamespace>My</CustomToolNamespace>
|
||||
<LastGenOutput>Settings.Designer.vb</LastGenOutput>
|
||||
</None>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="obj\" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
|
||||
</Project>
|
||||
6
deviceparsingdatalog.vbproj.user
Normal file
6
deviceparsingdatalog.vbproj.user
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,7 @@
|
||||
' <autogenerated/>
|
||||
Option Strict Off
|
||||
Option Explicit On
|
||||
|
||||
Imports System
|
||||
Imports System.Reflection
|
||||
<Assembly: Global.System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName:=".NET Framework 4.8")>
|
||||
BIN
obj/Debug/DataPresentationManager.Form1.resources
Normal file
BIN
obj/Debug/DataPresentationManager.Form1.resources
Normal file
Binary file not shown.
BIN
obj/Debug/DataPresentationManager.Resources.resources
Normal file
BIN
obj/Debug/DataPresentationManager.Resources.resources
Normal file
Binary file not shown.
BIN
obj/Debug/DataPresentationManager.exe
Normal file
BIN
obj/Debug/DataPresentationManager.exe
Normal file
Binary file not shown.
BIN
obj/Debug/DataPresentationManager.pdb
Normal file
BIN
obj/Debug/DataPresentationManager.pdb
Normal file
Binary file not shown.
BIN
obj/Debug/DataPresentationManager.vbproj.AssemblyReference.cache
Normal file
BIN
obj/Debug/DataPresentationManager.vbproj.AssemblyReference.cache
Normal file
Binary file not shown.
@@ -0,0 +1 @@
|
||||
b8b81cef4938a2e2de7449ba4c0a813209b0007a
|
||||
@@ -0,0 +1,48 @@
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\DataPresentationManager.exe
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\MySql.Data.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Data.SQLite.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\TeeChart.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\DataPresentationManager.exe.config
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\DataPresentationManager.pdb
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\DataPresentationManager.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\BouncyCastle.Cryptography.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\FlexCell.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\Google.Protobuf.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\K4os.Compression.LZ4.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\K4os.Compression.LZ4.Streams.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\K4os.Hash.xxHash.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\Microsoft.Bcl.AsyncInterfaces.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Buffers.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Configuration.ConfigurationManager.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Diagnostics.DiagnosticSource.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.IO.Pipelines.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Memory.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Numerics.Vectors.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Threading.Tasks.Extensions.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\ZstdSharp.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\BouncyCastle.Cryptography.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\Google.Protobuf.pdb
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\Google.Protobuf.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\K4os.Compression.LZ4.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\K4os.Compression.LZ4.Streams.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\K4os.Hash.xxHash.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\MySql.Data.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Buffers.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Data.SQLite.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Diagnostics.DiagnosticSource.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.IO.Pipelines.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Memory.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Numerics.Vectors.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\bin\Debug\System.Threading.Tasks.Extensions.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.Form1.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.Resources.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.vbproj.GenerateResource.cache
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.vbproj.CoreCompileInputs.cache
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.vbproj.CopyComplete
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.exe
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.pdb
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataPresentationManager\obj\Debug\DataPresentationManager.vbproj.AssemblyReference.cache
|
||||
BIN
obj/Debug/DataPresentationManager.vbproj.GenerateResource.cache
Normal file
BIN
obj/Debug/DataPresentationManager.vbproj.GenerateResource.cache
Normal file
Binary file not shown.
1209
obj/Debug/DataPresentationManager.xml
Normal file
1209
obj/Debug/DataPresentationManager.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
BIN
obj/Debug/DesignTimeResolveAssemblyReferences.cache
Normal file
Binary file not shown.
BIN
obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
BIN
obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
Normal file
Binary file not shown.
BIN
obj/Debug/TempPE/My Project.Resources.Designer.vb.dll
Normal file
BIN
obj/Debug/TempPE/My Project.Resources.Designer.vb.dll
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.C5_MUSIC.resources
Normal file
BIN
obj/Debug/deviceparsingdatalog.C5_MUSIC.resources
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.CS_IO_Type.resources
Normal file
BIN
obj/Debug/deviceparsingdatalog.CS_IO_Type.resources
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.Form1.resources
Normal file
BIN
obj/Debug/deviceparsingdatalog.Form1.resources
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.Form2.resources
Normal file
BIN
obj/Debug/deviceparsingdatalog.Form2.resources
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.Resources.resources
Normal file
BIN
obj/Debug/deviceparsingdatalog.Resources.resources
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.exe
Normal file
BIN
obj/Debug/deviceparsingdatalog.exe
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.pdb
Normal file
BIN
obj/Debug/deviceparsingdatalog.pdb
Normal file
Binary file not shown.
BIN
obj/Debug/deviceparsingdatalog.vbproj.AssemblyReference.cache
Normal file
BIN
obj/Debug/deviceparsingdatalog.vbproj.AssemblyReference.cache
Normal file
Binary file not shown.
0
obj/Debug/deviceparsingdatalog.vbproj.CopyComplete
Normal file
0
obj/Debug/deviceparsingdatalog.vbproj.CopyComplete
Normal file
@@ -0,0 +1 @@
|
||||
69f19e702138b9010e7e063b050599827d127309
|
||||
155
obj/Debug/deviceparsingdatalog.vbproj.FileListAbsolute.txt
Normal file
155
obj/Debug/deviceparsingdatalog.vbproj.FileListAbsolute.txt
Normal file
@@ -0,0 +1,155 @@
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\deviceparsingdatalog.exe.config
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\deviceparsingdatalog.exe
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\deviceparsingdatalog.pdb
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\deviceparsingdatalog.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\BouncyCastle.Cryptography.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\FlexCell.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\Google.Protobuf.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\K4os.Compression.LZ4.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\K4os.Compression.LZ4.Streams.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\K4os.Hash.xxHash.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\Microsoft.Bcl.AsyncInterfaces.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\MySql.Data.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Buffers.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Configuration.ConfigurationManager.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Diagnostics.DiagnosticSource.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.IO.Pipelines.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Memory.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Numerics.Vectors.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Threading.Tasks.Extensions.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\ZstdSharp.dll
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\BouncyCastle.Cryptography.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\Google.Protobuf.pdb
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\Google.Protobuf.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\K4os.Compression.LZ4.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\K4os.Compression.LZ4.Streams.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\K4os.Hash.xxHash.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\MySql.Data.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Buffers.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Data.SQLite.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Diagnostics.DiagnosticSource.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.IO.Pipelines.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Memory.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Numerics.Vectors.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
|
||||
E:\PC_Project\deviceparsingdatalog\bin\Debug\System.Threading.Tasks.Extensions.xml
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.Form1.resources
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.Resources.resources
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.vbproj.GenerateResource.cache
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.vbproj.CoreCompileInputs.cache
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.vbproj.CopyComplete
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.exe
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.xml
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.pdb
|
||||
E:\PC_Project\deviceparsingdatalog\obj\Debug\deviceparsingdatalog.vbproj.AssemblyReference.cache
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.exe.config
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.exe
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.pdb
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Crypto.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Cryptography.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\FlexCell.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\FluentFTP.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Google.Protobuf.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.Streams.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\K4os.Hash.xxHash.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Microsoft.Bcl.AsyncInterfaces.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\MySql.Data.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Buffers.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Configuration.ConfigurationManager.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Data.SQLite.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Diagnostics.DiagnosticSource.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.IO.Pipelines.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Memory.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Numerics.Vectors.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Threading.Tasks.Extensions.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\TeeChart.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\ZstdSharp.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Crypto.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Cryptography.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\FluentFTP.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Google.Protobuf.pdb
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Google.Protobuf.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.Streams.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\K4os.Hash.xxHash.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\MySql.Data.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Buffers.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Diagnostics.DiagnosticSource.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.IO.Pipelines.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Memory.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Numerics.Vectors.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\System.Threading.Tasks.Extensions.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.AssemblyReference.cache
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.C5_MUSIC.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.CS_IO_Type.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.Form1.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.Resources.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.GenerateResource.cache
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.CoreCompileInputs.cache
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.CopyComplete
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.exe
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.xml
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.pdb
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.Form2.resources
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Newtonsoft.Json.dll
|
||||
D:\Sync\RD_PC\陈志豪\czh\DataAnalysisAndViewing\bin\Debug\Newtonsoft.Json.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.C5_MUSIC.resources
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.CS_IO_Type.resources
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.Form1.resources
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.Form2.resources
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.Resources.resources
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.GenerateResource.cache
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.CoreCompileInputs.cache
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.AssemblyReference.cache
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.exe.config
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.exe
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.pdb
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\deviceparsingdatalog.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Crypto.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Cryptography.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\FluentFTP.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Google.Protobuf.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.Streams.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\K4os.Hash.xxHash.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Microsoft.Bcl.AsyncInterfaces.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\MySql.Data.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Newtonsoft.Json.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Buffers.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Configuration.ConfigurationManager.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Diagnostics.DiagnosticSource.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.IO.Pipelines.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Memory.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Numerics.Vectors.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Runtime.CompilerServices.Unsafe.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Threading.Tasks.Extensions.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\ZstdSharp.dll
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Crypto.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\BouncyCastle.Cryptography.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\FluentFTP.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Google.Protobuf.pdb
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Google.Protobuf.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\K4os.Compression.LZ4.Streams.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\K4os.Hash.xxHash.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Microsoft.Bcl.AsyncInterfaces.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\MySql.Data.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\Newtonsoft.Json.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Buffers.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Diagnostics.DiagnosticSource.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.IO.Pipelines.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Memory.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Numerics.Vectors.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Runtime.CompilerServices.Unsafe.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\bin\Debug\System.Threading.Tasks.Extensions.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.vbproj.CopyComplete
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.exe
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.xml
|
||||
E:\Sync\DataAnalysisAndViewing\DataAnalysisAndViewing\obj\Debug\deviceparsingdatalog.pdb
|
||||
BIN
obj/Debug/deviceparsingdatalog.vbproj.GenerateResource.cache
Normal file
BIN
obj/Debug/deviceparsingdatalog.vbproj.GenerateResource.cache
Normal file
Binary file not shown.
2384
obj/Debug/deviceparsingdatalog.xml
Normal file
2384
obj/Debug/deviceparsingdatalog.xml
Normal file
File diff suppressed because it is too large
Load Diff
24
packages.config
Normal file
24
packages.config
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="BouncyCastle.Cryptography" version="2.2.1" targetFramework="net48" />
|
||||
<package id="FluentFTP" version="33.0.3" targetFramework="net48" />
|
||||
<package id="Google.Protobuf" version="3.21.9" targetFramework="net48" />
|
||||
<package id="K4os.Compression.LZ4" version="1.2.16" targetFramework="net48" />
|
||||
<package id="K4os.Compression.LZ4.Streams" version="1.2.16" targetFramework="net48" />
|
||||
<package id="K4os.Hash.xxHash" version="1.0.7" targetFramework="net48" />
|
||||
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net48" />
|
||||
<package id="MySql.Data" version="8.0.32.1" targetFramework="net48" />
|
||||
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net48" />
|
||||
<package id="PerseusLibS" version="1.6.15.773" targetFramework="net48" />
|
||||
<package id="Portable.BouncyCastle" version="1.9.0" targetFramework="net48" />
|
||||
<package id="System.Buffers" version="4.5.1" targetFramework="net48" />
|
||||
<package id="System.Configuration.ConfigurationManager" version="4.4.1" targetFramework="net48" />
|
||||
<package id="System.Diagnostics.DiagnosticSource" version="5.0.1" targetFramework="net48" />
|
||||
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net48" />
|
||||
<package id="System.Memory" version="4.5.5" targetFramework="net48" />
|
||||
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net48" />
|
||||
<package id="System.Runtime" version="4.3.0" targetFramework="net48" />
|
||||
<package id="System.Runtime.CompilerServices.Unsafe" version="5.0.0" targetFramework="net48" />
|
||||
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net48" />
|
||||
<package id="ZstdSharp.Port" version="0.7.1" targetFramework="net48" />
|
||||
</packages>
|
||||
BIN
packages/BouncyCastle.Cryptography.2.2.1/.signature.p7s
vendored
Normal file
BIN
packages/BouncyCastle.Cryptography.2.2.1/.signature.p7s
vendored
Normal file
Binary file not shown.
BIN
packages/BouncyCastle.Cryptography.2.2.1/BouncyCastle.Cryptography.2.2.1.nupkg
vendored
Normal file
BIN
packages/BouncyCastle.Cryptography.2.2.1/BouncyCastle.Cryptography.2.2.1.nupkg
vendored
Normal file
Binary file not shown.
13
packages/BouncyCastle.Cryptography.2.2.1/LICENSE.md
vendored
Normal file
13
packages/BouncyCastle.Cryptography.2.2.1/LICENSE.md
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2000-2023 The Legion of the Bouncy Castle Inc. (https://www.bouncycastle.org).
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
||||
including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
sub license, and/or sell copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions: The above copyright notice and this
|
||||
permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
|
||||
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
|
||||
OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.**
|
||||
45
packages/BouncyCastle.Cryptography.2.2.1/README.md
vendored
Normal file
45
packages/BouncyCastle.Cryptography.2.2.1/README.md
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
# The Bouncy Castle Cryptography Library For .NET
|
||||
[](https://www.nuget.org/packages/BouncyCastle.Cryptography) [](https://www.nuget.org/packages/BouncyCastle.Cryptography)
|
||||
|
||||
The Bouncy Castle Cryptography library is a .NET implementation of cryptographic algorithms and protocols. It was developed by the Legion of the Bouncy Castle, a registered Australian Charity, with a little help! The Legion, and the latest goings on with this package, can be found at [https://www.bouncycastle.org](https://www.bouncycastle.org).
|
||||
|
||||
In addition to providing basic cryptography algorithms, the package also provides support for CMS, OpenPGP, (D)TLS, TSP, X.509 certificate generation and more. The package also includes implementations of the following NIST Post-Quantum Cryptography Standardization algorithms: CRYSTALS-Dilithium, CRYSTALS-Kyber, Falcon, SPHINCS+, Classic McEliece, FrodoKEM, NTRU, NTRU Prime, Picnic, Saber, BIKE, and SIKE. These should all be considered EXPERIMENTAL and subject to change or removal. SIKE in particular is already slated for removal and should be used for research purposes only.
|
||||
|
||||
The Legion also gratefully acknowledges the contributions made to this package by others (see [here](https://www.bouncycastle.org/csharp/contributors.html) for the current list). If you would like to contribute to our efforts please feel free to get in touch with us or visit our [donations page](https://www.bouncycastle.org/donate), sponsor some specific work, or purchase a [support contract](https://www.keyfactor.com/platform/bouncy-castle-support/).
|
||||
|
||||
Except where otherwise stated, this software is distributed under a license based on the MIT X Consortium license. To view the license, [see here](https://www.bouncycastle.org/licence.html). This software includes a modified Bzip2 library, which is licensed under the [Apache Software License, Version 2.0](http://www.apache.org/licenses/).
|
||||
|
||||
**Note**: This source tree is not the FIPS version of the APIs - if you are interested in our FIPS version please visit us [here](https://www.bouncycastle.org/fips-csharp) or contact us directly at [office@bouncycastle.org](mailto:office@bouncycastle.org).
|
||||
|
||||
## Installing BouncyCastle
|
||||
You should install [BouncyCastle with NuGet:](https://www.nuget.org/packages/BouncyCastle.Cryptography)
|
||||
|
||||
Install-Package BouncyCastle.Cryptography
|
||||
|
||||
Or via the .NET Core command line interface:
|
||||
|
||||
dotnet add package BouncyCastle.Cryptography
|
||||
|
||||
Either commands, from Package Manager Console or .NET Core CLI, will download and install BouncyCastle.Cryptography.
|
||||
|
||||
|
||||
## Mailing Lists
|
||||
|
||||
For those who are interested, there are 2 mailing lists for participation in this project. To subscribe use the links below and include the word subscribe in the message body. (To unsubscribe, replace **subscribe** with **unsubscribe** in the message body)
|
||||
|
||||
* [announce-crypto-csharp-request@bouncycastle.org](mailto:announce-crypto-csharp-request@bouncycastle.org)
|
||||
This mailing list is for new release announcements only, general subscribers cannot post to it.
|
||||
* [dev-crypto-csharp-request@bouncycastle.org](mailto:dev-crypto-csharp-request@bouncycastle.org)
|
||||
This mailing list is for discussion of development of the package. This includes bugs, comments, requests for enhancements, questions about use or operation.
|
||||
|
||||
**NOTE:** You need to be subscribed to send mail to the above mailing list.
|
||||
|
||||
## Feedback
|
||||
|
||||
If you want to provide feedback directly to the members of **The Legion** then please use [feedback-crypto@bouncycastle.org](mailto:feedback-crypto@bouncycastle.org). If you want to help this project survive please consider [donating](https://www.bouncycastle.org/donate).
|
||||
|
||||
For bug reporting/requests you can report issues on [github](https://github.com/bcgit/bc-csharp), or via [feedback-crypto@bouncycastle.org](mailto:feedback-crypto@bouncycastle.org) if required. We will accept pull requests based on this repository as well, but only on the basis that any code included may be distributed under the [Bouncy Castle License](https://www.bouncycastle.org/licence.html).
|
||||
|
||||
## Finally
|
||||
|
||||
Enjoy!
|
||||
BIN
packages/BouncyCastle.Cryptography.2.2.1/lib/net461/BouncyCastle.Cryptography.dll
vendored
Normal file
BIN
packages/BouncyCastle.Cryptography.2.2.1/lib/net461/BouncyCastle.Cryptography.dll
vendored
Normal file
Binary file not shown.
29053
packages/BouncyCastle.Cryptography.2.2.1/lib/net461/BouncyCastle.Cryptography.xml
vendored
Normal file
29053
packages/BouncyCastle.Cryptography.2.2.1/lib/net461/BouncyCastle.Cryptography.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/BouncyCastle.Cryptography.2.2.1/lib/net6.0/BouncyCastle.Cryptography.dll
vendored
Normal file
BIN
packages/BouncyCastle.Cryptography.2.2.1/lib/net6.0/BouncyCastle.Cryptography.dll
vendored
Normal file
Binary file not shown.
29164
packages/BouncyCastle.Cryptography.2.2.1/lib/net6.0/BouncyCastle.Cryptography.xml
vendored
Normal file
29164
packages/BouncyCastle.Cryptography.2.2.1/lib/net6.0/BouncyCastle.Cryptography.xml
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user