''' <summary> ''' SQL文读取 ''' </summary> ''' <param name="sqlFilePath">sql文件路径</param> ''' <returns>SQL文</returns> ''' <remarks></remarks> Public Shared Function ReadSqlText(ByVal sqlFilePath As String) As String Dim strLine As String = "" Dim sbSql As New StringBuilder("") Dim reader As StreamReader = Nothing Try '选择相应的文件编码,不然会乱码 reader = New StreamReader(sqlFilePath, Encoding.Unicode) While reader.EndOfStream = False strLine = reader.ReadLine() sbSql.Append(strLine) sbSql.Append(vbNewLine) End While Return sbSql.ToString Catch ex As Exception Throw ex Finally If Not reader Is Nothing Then reader.Close() End If End Try End Function