OK this is probably really simple and i'm missing something easy!
heres the situation, i have a class called computersystem, in that class i have a method (function) that returns 3 values.
HERE IS the function for computer system class:
Public Structure Attributes
Public ip As String
Public networkName As String
Public dhcp As String
End Structure
Function ipAdd() As Attributes
Dim att As Attributes
Dim searcher As New ManagementObjectSearcher( _
"root\CIMV2", _
"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = true")
For Each ip As ManagementObject In searcher.Get()
Dim arrIPAddress As String()
Dim networkN As String
Dim dhcp As String
networkN = ip("Caption")
arrIPAddress = ip("IPAddress")
dhcp = ip("DHCPEnabled")
For Each arrValue As String In arrIPAddress
att.ip &= arrValue
Next
For Each arrValue As String In networkN
att.networkName &= arrValue
Next
For Each arrValue As String In dhcp
att.dhcp &= arrValue
Next
Next
Return att
End Function
NOW On a basic form1.vb
how do i add networkN , arrayIPAddress and dhcp in a list view box?
they show but in straight line not in rows. WHAT AM I DOING WRONG?
heres the situation, i have a class called computersystem, in that class i have a method (function) that returns 3 values.
HERE IS the function for computer system class:
Public Structure Attributes
Public ip As String
Public networkName As String
Public dhcp As String
End Structure
Function ipAdd() As Attributes
Dim att As Attributes
Dim searcher As New ManagementObjectSearcher( _
"root\CIMV2", _
"SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = true")
For Each ip As ManagementObject In searcher.Get()
Dim arrIPAddress As String()
Dim networkN As String
Dim dhcp As String
networkN = ip("Caption")
arrIPAddress = ip("IPAddress")
dhcp = ip("DHCPEnabled")
For Each arrValue As String In arrIPAddress
att.ip &= arrValue
Next
For Each arrValue As String In networkN
att.networkName &= arrValue
Next
For Each arrValue As String In dhcp
att.dhcp &= arrValue
Next
Next
Return att
End Function
NOW On a basic form1.vb
how do i add networkN , arrayIPAddress and dhcp in a list view box?
they show but in straight line not in rows. WHAT AM I DOING WRONG?
Last edited: