14 lines
493 B
VB.net
14 lines
493 B
VB.net
Imports Microsoft.EntityFrameworkCore
|
|
|
|
Public Class bbdd
|
|
Public Shared Function ObtieneIPMysql(bd As DbContext) As String
|
|
Try
|
|
Dim sConexion As String = bd.Database.SqlQuery(Of String)($"select host from information_schema.processlist WHERE ID=connection_id();").ToList.First
|
|
Dim sIP As String = sConexion.Split(":")(0)
|
|
Return sIP
|
|
Catch ex As Exception
|
|
Return "** desconocida **"
|
|
End Try
|
|
End Function
|
|
End Class
|