domingo, 11 de octubre de 2020

Network Interface (Cambiar la dirección IP con vb.Net)

En la actualidad, la mayoría de dispositivos en automatización industrial (PLCs, variadores, servos, etc.) utilizan puertos Ethernet. Esto implica que cada vez que se necesita conectar a un dispositivo, es necesario configurar manualmente las conexiones de red del puerto correspondiente.

Para mejorar esta situación, he desarrollado un programa en Visual Studio .Net que detecta los puertos de red habilitados y permite visualizar y modificar la configuración de red (dirección IP, máscara de red, puerta de enlace, DNS, así como el modo de configuración automática o estática). Además, facilita la transmisión de estas configuraciones al puerto de red correspondiente.


Una herramienta muy útil para los programadores de PLCs es el comando Ping. Por ello, he incorporado una línea en la parte inferior de la interfaz que permite ingresar una dirección para realizar un ping. Al presionar el botón de ping, si hay respuesta, los campos se marcarán en verde; en caso contrario, se marcarán en rojo para indicar la falta de respuesta.

 



Novedades de la Versión 2022_01_08:

- Se corrige el error que provoca tener la misma dirección ip en dos adaptadores diferentes. Antes de transmitir al adaptador (botón flecha bajo), el programa verifica si esta dirección se esta utilizando en otro adaptador. En caso de no poder transmitir, avisa con un mensaje

En este caso el adaptador wi-fi esta trabajando con la ip 192.168.18.6, al intentar transferir esta misma dirección al adaptador ethernet, el programa no me lo ha permitido

- Permite guardar/cargar recetas. En el desplegable amarillo aparecen hasta 10 recetas, cada vez que se selecciona una receta, muestra sus ajustes (ip, mask.gateway...). Para guardar una receta, se ajustan todos lo campos y para cambiar el nombre se hace del mismo desplegable, por último se pulsa "save recipe"

-Se añade una nueva función scanner. Este botón abre una nueva ventana, el cual realiza ping a varias direcciones. Podemos escoger entre dos opciones de multi-ping:

 Scan between two addressses. Hay que colocar la dirección inicial y la dirección final, cada vez la dirección ira incrementándose hasta llegar a la dirección final. El tiempo máximo del ping es el del campo "time out(ms)". Cada vez que el ping tenga éxito, mostrará su dirección en la pantalla

Scan by list. Esta opción esta pensada para utilizar una plantilla de excel que hice. En el cual hay un resumen de todos los dispositivos que usan ethernet de un proyecto. Se copian las celdas del excel y se pega en el cuadro de la izquierda. Automáticamente toda la información aparece arreglada en el cuadro de la derecha. Al iniciar el escaneo, si la linea aparece en verde el ping ha tenido éxito y lo contrario si aparece en rojo

Código vb.net:



Imports System.Net.NetworkInformation
Imports System.Management
Imports System.IO

Public Class ChangeIP

Dim IPAddress As String ' Direcció IP
Dim SubnetMask As String 'Màscara subxarxa
Dim Gateway As String 'porta enllaç
Dim DNS1 As String 'DNS1
Dim DNS2 As String 'DNS2
Dim PING As String 'direcció del ping


Dim strInterface(20) As String
Dim ip_Estatic(20) As Boolean
Dim strAdressIP(20) As String
Dim strSubnetMask(20) As String
Dim strGateway(20) As String
Dim DNS_Estatic(20) As Boolean
Dim strDNS1(20) As String
Dim strDNS2(20) As String
Dim countVisible As Integer

Dim disableLedPing As Integer

Dim ToolTip1 As New ToolTip()
Dim MAX_RECETAS As Integer = 10
Dim nomReceta(MAX_RECETAS) As String


Private Sub btnPing_Click(sender As Object, e As EventArgs) Handles bPing.Click
'Funció del boto ping, el led té tres estats off= defecte, roig= fallo i verd= ping ok

PING = P3.Text & sep & P2.Text & sep & P1.Text & sep & P0.Text
'Shell("PING " & PING)

P0.BackColor = Color.Yellow


Try
If My.Computer.Network.Ping(PING, 1000) Then
' MsgBox("Server pinged successfully.")
P0.BackColor = Color.Green
Else
' MsgBox("Ping request timed out.")
P0.BackColor = Color.Tomato
End If

Catch ex As Exception
MsgBox("error, please try again")

End Try

P1.BackColor = P0.BackColor
P2.BackColor = P0.BackColor
P3.BackColor = P0.BackColor

disableLedPing = 10
End Sub

Private Sub IP_Config_Click(sender As Object, e As EventArgs)
'Funció boto del cmd ipConfig

Shell("ipconfig /all")
'Process.Start("ipconfig ", "/all")
End Sub


Private Sub btnDownload_Click(sender As Object, e As EventArgs) Handles bDownload.Click
'Transmete els parametres al PC
Dim cmd1, cmd2, cmd3, pre_cmd1, pre_cmd2, pre_cmd3 As String
Dim falloDuplica, falloEmpty As Boolean

P3.Text = IP3.Text 'Pose la direcció del ping en el rango
P2.Text = IP2.Text
P1.Text = IP1.Text

'---------------------------------------------------------------------------
IPAddress = IP3.Text & sep & IP2.Text & sep & IP1.Text & sep & IP0.Text
SubnetMask = M3.Text & sep & M2.Text & sep & M1.Text & sep & M0.Text
Gateway = GT3.Text & sep & GT2.Text & sep & GT1.Text & sep & GT0.Text
If GT3.Text = "" Or GT2.Text = "" Or GT1.Text = "" Or GT0.Text = "" Then
Gateway = ""
End If

For i = 0 To 20 'Comprove que ninguna interface tinga la ip, sino dona error
If iStatic.Checked And (strAdressIP(i) = IPAddress) And (cAdapter.SelectedIndex <> i) Then
MsgBox("The interface " & Chr(34) & strInterface(i) & Chr(34) & " have this address! It's no possible to transfer.")
falloDuplica = True
End If
Next
falloEmpty = iStatic.Checked And (IP3.Text = "" Or IP2.Text = "" Or IP1.Text = "" Or IP0.Text = "" Or M3.Text = "" Or M2.Text = "" Or M1.Text = "" Or M0.Text = "")

If falloEmpty Then
MsgBox("Empty field! For a static address is necessary all values of Ip Address and Subnet Mask")
End If
If Not falloDuplica And Not falloEmpty Then
pre_cmd1 = "Netsh interface ipv4 set address name=" & Chr(34) & cAdapter.Text & Chr(34)
If iStatic.Checked Then
cmd1 = pre_cmd1 & " source=static" & " " & IPAddress & " " & SubnetMask & " " & Gateway 'ip estatica
Else
cmd1 = pre_cmd1 & " source=dhcp" 'ip dinamica
End If

Shell(cmd1)
Threading.Thread.Sleep(500)
End If
'---------------------------------------------------------------------------
If dStatic.Checked And (D13.Text = "" Or D12.Text = "" Or D11.Text = "" Or D10.Text = "" Or D23.Text = "" Or D22.Text = "" Or D21.Text = "" Or D20.Text = "") Then
MsgBox("Empty field! For a static DNS is necessary all values of DNS1 and DNS2")
Else
DNS1 = D13.Text & sep & D12.Text & sep & D11.Text & sep & D10.Text
DNS2 = D23.Text & sep & D22.Text & sep & D21.Text & sep & D20.Text
pre_cmd2 = "Netsh interface ip set dns name=" & Chr(34) & cAdapter.Text & Chr(34)
pre_cmd3 = "Netsh interface ip add dns name=" & Chr(34) & cAdapter.Text & Chr(34)
If dStatic.Checked Then

cmd2 = pre_cmd2 & " static" & " " & DNS1
cmd3 = pre_cmd3 & " addr=" & " " & DNS2 & " " & " index=2" 'dns estatica
Else
cmd2 = pre_cmd2 & " dhcp"
cmd3 = pre_cmd3 & " dhcp" & " " & " index=2" 'ip dinamica
End If
Shell(cmd2)
Threading.Thread.Sleep(500)
Shell(cmd3)

End If

TextBox1.Text = cmd1
Threading.Thread.Sleep(1000)

End Sub

Private Sub btnUpload_Click(sender As Object, e As EventArgs) Handles bUpload.Click

Dim i As Integer = cAdapter.SelectedIndex

GetAdapters()
If cAdapter.Items.Count() > 0 Then
cAdapter.SelectedIndex = i
End If

UpdateText()

End Sub
Private Sub ChangeIP_Load(sender As Object, e As EventArgs) Handles MyBase.Load

cRecipeId.SelectedIndex = My.Settings.recetaAct
GetAdapters()
If cAdapter.Items.Count() > 0 Then
cAdapter.SelectedIndex = 0
End If
ActComboboxRecipe()
End Sub

Private Sub btnNCPA_Click(sender As Object, e As EventArgs) Handles bNetworkAdapters.Click
Process.Start("ncpa.cpl") 'Obri configuracions
End Sub

Sub GetAdapters()

Dim i As Integer = 0
Dim strAdressIP_copy As String
Dim strSubnetMask_copy As String
Dim strGateway_copy As String
Dim temp() As String

cAdapter.Items.Clear()

For Each adapter As NetworkInterface In NetworkInterface.GetAllNetworkInterfaces()

strInterface(i) = ""
strAdressIP(i) = ""
strSubnetMask(i) = ""
strGateway(i) = ""
strDNS1(i) = ""
strDNS2(i) = ""
ip_Estatic(i) = False
DNS_Estatic(i) = False

strInterface(i) = adapter.Name.ToString()
Me.cAdapter.Items.Add(strInterface(i))

ip_Estatic(i) = Not (adapter.GetIPProperties.GetIPv4Properties.IsDhcpEnabled)
DNS_Estatic(i) = adapter.GetIPProperties.IsDynamicDnsEnabled
'Label7.Text = adapter.GetIPProperties.UnicastAddresses.Add("192.168.8.1").tostring()

For Each gateway As GatewayIPAddressInformation In adapter.GetIPProperties.GatewayAddresses()
strGateway(i) = gateway.Address.ToString()
Next
temp = pos(strGateway(i))
'strGateway_copy



For Each addr As UnicastIPAddressInformation In adapter.GetIPProperties.UnicastAddresses()
strAdressIP(i) = addr.Address.ToString()
strSubnetMask(i) = addr.IPv4Mask.ToString()
Next



If adapter.GetIPProperties.DnsAddresses.Count > 0 Then
strDNS1(i) = adapter.GetIPProperties.DnsAddresses(0).ToString()
End If
If adapter.GetIPProperties.DnsAddresses.Count > 1 Then
strDNS2(i) = adapter.GetIPProperties.DnsAddresses(1).ToString()
End If

i = i + 1
Next

End Sub


Public Function pos(strinput As String) As String()

Dim dir() As Char
Dim part(10) As String

' Dim direction As address
Dim dot As Integer = 0
Dim temp As String
part = {"", "", "", ""}

dir = strinput.ToCharArray() + sep

If dir.Length() > 0 Then

For counter As Integer = 0 To dir.Length() - 1

If dir(counter) = sep Then
part(dot) = temp
dot = dot + 1
temp = ""
Else
temp = temp & dir(counter)
If temp.Length > 3 Then
temp = ""
Exit For
End If
End If

Next

End If

pos = part
End Function

Sub UpdateText()
Dim i As Integer

i = cAdapter.SelectedIndex()

Dim temp As String()

temp = {"", "", "", ""}
temp = pos(strAdressIP(i))
IP3.Text = temp(0)
IP2.Text = temp(1)
IP1.Text = temp(2)
IP0.Text = temp(3)

'txtIpAdress.Text = strAdressIP(i)

temp = {"", "", "", ""}
temp = pos(strSubnetMask(i))
M3.Text = temp(0)
M2.Text = temp(1)
M1.Text = temp(2)
M0.Text = temp(3)

temp = {"", "", "", ""}
temp = pos(strGateway(i))
GT3.Text = temp(0)
GT2.Text = temp(1)
GT1.Text = temp(2)
GT0.Text = temp(3)

'ip_Estatic(i) = False
'If IsNumeric(IPAddress3.Text) Then
' ip_Estatic(i) = True
'End If
iStatic.Checked = ip_Estatic(i)
iDinamic.Checked = Not (ip_Estatic(i))

temp = {"", "", "", ""}
temp = pos(strDNS1(i))
D13.Text = temp(0)
D12.Text = temp(1)
D11.Text = temp(2)
D10.Text = temp(3)
temp = {"", "", "", ""}
temp = pos(strDNS2(i))
D23.Text = temp(0)
D22.Text = temp(1)
D21.Text = temp(2)
D20.Text = temp(3)

'DNS_Estatic(i) = False
'If IsNumeric(DNS13.Text) Then
' DNS_Estatic(i) = True
'End If
dStatic.Checked = DNS_Estatic(i)
dDinamic.Checked = Not (DNS_Estatic(i))

End Sub

Private Sub cmbNetworkInterface_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cAdapter.SelectedIndexChanged

' GetParam()
' UpdateText()
End Sub

Public Function check_format(in_format As String) As String
Dim temp As String

temp = in_format
If Not IsNumeric(in_format) Then
temp = ""
Else
If CInt(in_format) > 255 Then
temp = "255"
End If
End If
check_format = temp
End Function
Private Sub IPAddress0_TextChanged(sender As Object, e As EventArgs) Handles IP0.TextChanged
If (IP0.Text.Length >= 3) Then
M3.Focus()
End If
IP0.Text = check_format(IP0.Text)
End Sub
Private Sub IPAddress1_TextChanged(sender As Object, e As EventArgs) Handles IP1.TextChanged
If (IP1.Text.Length >= 3) Then
IP0.Focus()
End If
IP1.Text = check_format(IP1.Text)
If M1.Text = "255" Then
GT1.Text = IP1.Text
P1.Text = IP1.Text
End If
End Sub

Private Sub IPAddress2_TextChanged(sender As Object, e As EventArgs) Handles IP2.TextChanged
If (IP2.Text.Length >= 3) Then
IP1.Focus()
End If
IP2.Text = check_format(IP2.Text)
If M2.Text = "255" Then
GT2.Text = IP2.Text
P2.Text = IP2.Text
End If
End Sub
Private Sub IPAddress3_TextChanged(sender As Object, e As EventArgs) Handles IP3.TextChanged
If (IP3.Text.Length >= 3) Then
IP2.Focus()
End If
IP3.Text = check_format(IP3.Text)
If M3.Text = "255" Then
GT3.Text = IP3.Text
P3.Text = IP3.Text
End If
End Sub
Private Sub SubnetMask0_TextChanged(sender As Object, e As EventArgs) Handles M0.TextChanged
If (M0.Text.Length >= 3) Then
GT3.Focus()
End If
M0.Text = check_format(M0.Text)
End Sub
Private Sub SubnetMask1_TextChanged(sender As Object, e As EventArgs) Handles M1.TextChanged
If (M1.Text.Length >= 3) Then
M0.Focus()
End If
M1.Text = check_format(M1.Text)
If M1.Text = "255" Then
GT1.Text = IP1.Text
P1.Text = IP1.Text
End If
End Sub
Private Sub SubnetMask2_TextChanged(sender As Object, e As EventArgs) Handles M2.TextChanged
If (M2.Text.Length >= 3) Then
M1.Focus()
End If
M2.Text = check_format(M2.Text)
If M2.Text = "255" Then
GT2.Text = IP2.Text
P2.Text = IP2.Text
End If
End Sub
Private Sub SubnetMask3_TextChanged(sender As Object, e As EventArgs) Handles M3.TextChanged
If (M3.Text.Length >= 3) Then
M2.Focus()
End If
M3.Text = check_format(M3.Text)
If M3.Text = "255" Then
GT3.Text = IP3.Text
P3.Text = IP3.Text
End If
End Sub

Private Sub Gateway0_TextChanged(sender As Object, e As EventArgs) Handles GT0.TextChanged
If (GT0.Text.Length >= 3) Then
D23.Focus()
End If
GT0.Text = check_format(GT0.Text)
End Sub

Private Sub Gateway1_TextChanged(sender As Object, e As EventArgs) Handles GT1.TextChanged
'If (Gateway1.Text.Length >= 3) Then
' Gateway0.Focus()
'End If
GT1.Text = check_format(GT1.Text)
End Sub

Private Sub Gateway2_TextChanged(sender As Object, e As EventArgs) Handles GT2.TextChanged
'If (Gateway2.Text.Length >= 3) Then
' Gateway1.Focus()
'End If
GT2.Text = check_format(GT2.Text)
End Sub

Private Sub Gateway3_TextChanged(sender As Object, e As EventArgs) Handles GT3.TextChanged
'If (Gateway3.Text.Length >= 3) Then
' Gateway2.Focus()
'End If
GT3.Text = check_format(GT3.Text)
End Sub

Private Sub d10_TextChanged(sender As Object, e As EventArgs) Handles D10.TextChanged

D10.Text = check_format(D10.Text)
End Sub

Private Sub d11_TextChanged(sender As Object, e As EventArgs) Handles D11.TextChanged

D11.Text = check_format(D11.Text)
End Sub

Private Sub d12_TextChanged(sender As Object, e As EventArgs) Handles D12.TextChanged
D12.Text = check_format(D12.Text)
End Sub

Private Sub d13_TextChanged(sender As Object, e As EventArgs) Handles D13.TextChanged
D13.Text = check_format(D13.Text)
End Sub

Private Sub d20_TextChanged(sender As Object, e As EventArgs) Handles D20.TextChanged
D20.Text = check_format(D20.Text)
End Sub

Private Sub d21_TextChanged(sender As Object, e As EventArgs) Handles D21.TextChanged
D21.Text = check_format(D21.Text)
End Sub

Private Sub d22_TextChanged(sender As Object, e As EventArgs) Handles D22.TextChanged
D22.Text = check_format(D22.Text)
End Sub

Private Sub d23_TextChanged(sender As Object, e As EventArgs) Handles D23.TextChanged
D23.Text = check_format(D23.Text)
End Sub

Private Sub PING0_TextChanged(sender As Object, e As EventArgs) Handles P0.TextChanged
P0.Text = check_format(P0.Text)
End Sub

Private Sub PING1_TextChanged(sender As Object, e As EventArgs) Handles P1.TextChanged
P1.Text = check_format(P1.Text)
End Sub

Private Sub PING2_TextChanged(sender As Object, e As EventArgs) Handles P2.TextChanged
P2.Text = check_format(P2.Text)
End Sub

Private Sub PING3_TextChanged(sender As Object, e As EventArgs) Handles P3.TextChanged
P3.Text = check_format(P3.Text)
End Sub

Private Sub Timer1_Tick_1(sender As Object, e As EventArgs) Handles Timer1.Tick
If disableLedPing > 0 Then
disableLedPing = disableLedPing - 1
End If

If disableLedPing = 0 Then
P0.BackColor = Color.White
End If
P1.BackColor = P0.BackColor
P2.BackColor = P0.BackColor
P3.BackColor = P0.BackColor
End Sub

Private Sub iStatic_CheckedChanged(sender As Object, e As EventArgs) Handles iStatic.CheckedChanged
iDinamic.Checked = Not iStatic.Checked
End Sub
Private Sub iDinamic_CheckedChanged(sender As Object, e As EventArgs) Handles iDinamic.CheckedChanged
iStatic.Checked = Not iDinamic.Checked
End Sub
Private Sub dStatic_CheckedChanged(sender As Object, e As EventArgs) Handles dStatic.CheckedChanged
dDinamic.Checked = Not dStatic.Checked
End Sub
Private Sub dDinamic_CheckedChanged(sender As Object, e As EventArgs) Handles dDinamic.CheckedChanged
dStatic.Checked = Not dDinamic.Checked
End Sub

Private Sub Label6_Click_1(sender As Object, e As EventArgs) Handles Label6.Click
countVisible = countVisible + 1
If countVisible > 5 Then
TextBox1.Visible = True
End If
End Sub

Private Sub bScanner_Click(sender As Object, e As EventArgs) Handles bScanner.Click
Scanner.Show()
End Sub

Private Sub btTemp_Click(sender As Object, e As EventArgs) Handles bTemp.Click
Shell("explorer C:\Users\" + Environment.UserName + "\AppData\Local\Temp , vbMaximizedFocu")
Threading.Thread.Sleep(500)
Shell("explorer C:\Windows\Temp , vbMaximizedFocu")

End Sub
Private Sub ActComboboxRecipe()
My.Settings.recetaAct = cRecipeId.SelectedIndex

nomReceta(1) = ReadCellCSV(My.Settings.receta01, 0)
nomReceta(2) = ReadCellCSV(My.Settings.receta02, 0)
nomReceta(3) = ReadCellCSV(My.Settings.receta03, 0)
nomReceta(4) = ReadCellCSV(My.Settings.receta04, 0)
nomReceta(5) = ReadCellCSV(My.Settings.receta05, 0)
nomReceta(6) = ReadCellCSV(My.Settings.receta06, 0)
nomReceta(7) = ReadCellCSV(My.Settings.receta07, 0)
nomReceta(8) = ReadCellCSV(My.Settings.receta08, 0)
nomReceta(9) = ReadCellCSV(My.Settings.receta09, 0)
nomReceta(10) = ReadCellCSV(My.Settings.receta10, 0)

'cRecipeId.Items.Clear()
For i = 0 To MAX_RECETAS - 1
cRecipeId.Items.RemoveAt(i)
cRecipeId.Items.Insert(i, nomReceta(i + 1))
Next

cRecipeId.SelectedIndex = My.Settings.recetaAct

End Sub
Private Sub bSave_Click(sender As Object, e As EventArgs) Handles bSave.Click
Dim str As String = String.Empty

' nomReceta(My.Settings.recetaAct + 1) = cRecipeId.Text

str = cRecipeId.Text & c _
& IIf(iStatic.Checked, 1, 0) & c _
& IP3.Text & c & IP2.Text & c & IP1.Text & c & IP0.Text & c _
& M3.Text & c & M2.Text & c & M1.Text & c & M0.Text & c _
& GT3.Text & c & GT2.Text & c & GT1.Text & c & GT0.Text & c _
& IIf(dStatic.Checked, 1, 0) & c _
& D13.Text & c & D12.Text & c & D11.Text & c & D10.Text & c _
& D23.Text & c & D22.Text & c & D21.Text & c & D20.Text

TextBox1.Text = str

Select Case My.Settings.recetaAct
Case 0
My.Settings.receta01 = str
Case 1
My.Settings.receta02 = str
Case 2
My.Settings.receta03 = str
Case 3
My.Settings.receta04 = str
Case 4
My.Settings.receta05 = str
Case 5
My.Settings.receta06 = str
Case 6
My.Settings.receta07 = str
Case 7
My.Settings.receta08 = str
Case 8
My.Settings.receta09 = str
Case 9
My.Settings.receta10 = str
End Select

ActComboboxRecipe()
End Sub


Private Sub cRecipeId_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cRecipeId.SelectedIndexChanged
Dim str As String = ""
Dim PermisoLectura As Boolean = False
Dim i As Integer = cRecipeId.SelectedIndex

If My.Settings.recetaAct <> i Then
ActComboboxRecipe()
End If

Select Case i
Case 0
str = My.Settings.receta01
Case 1
str = My.Settings.receta02
Case 2
str = My.Settings.receta03
Case 3
str = My.Settings.receta04
Case 4
str = My.Settings.receta05
Case 5
str = My.Settings.receta06
Case 6
str = My.Settings.receta07
Case 7
str = My.Settings.receta08
Case 8
str = My.Settings.receta09
Case 9
str = My.Settings.receta10
End Select

If str.Length > 5 Then
PermisoLectura = True
Else
cRecipeId.Text = "Empty "
End If


If PermisoLectura Then

cRecipeId.Text = ReadCellCSV(str, 0)

iStatic.Checked = (ReadCellCSV(str, 1) = "1")
IP3.Text = ReadCellCSV(str, 2)
IP2.Text = ReadCellCSV(str, 3)
IP1.Text = ReadCellCSV(str, 4)
IP0.Text = ReadCellCSV(str, 5)

M3.Text = ReadCellCSV(str, 6)
M2.Text = ReadCellCSV(str, 7)
M1.Text = ReadCellCSV(str, 8)
M0.Text = ReadCellCSV(str, 9)

GT3.Text = ReadCellCSV(str, 10)
GT2.Text = ReadCellCSV(str, 11)
GT1.Text = ReadCellCSV(str, 12)
GT0.Text = ReadCellCSV(str, 13)

dStatic.Checked = (ReadCellCSV(str, 14) = "1")
D13.Text = ReadCellCSV(str, 15)
D12.Text = ReadCellCSV(str, 16)
D11.Text = ReadCellCSV(str, 17)
D10.Text = ReadCellCSV(str, 18)

D23.Text = ReadCellCSV(str, 19)
D22.Text = ReadCellCSV(str, 20)
D21.Text = ReadCellCSV(str, 21)
D20.Text = ReadCellCSV(str, 22)

End If

My.Settings.recetaAct = cRecipeId.SelectedIndex
End Sub

Private Sub btInformation_Click(sender As Object, e As EventArgs) Handles btInformation.Click
MessageBox.Show("Network Interface" & vbCr & vbLf _
& "Version: " & My.Settings.version & vbCr & vbLf _
& "By: " & My.Settings.email & vbCr & vbLf _
& "", "About")
End Sub


End Class


 

 Descargar proyecto: https://drive.google.com/drive/folders/1xYnuknoPeBBYzKSd5Rr0gDVwF4EgWU0Y