Click here to Skip to main content
15,929,025 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: add key in web config confusing. Pin
uglyeyes19-Mar-06 11:46
uglyeyes19-Mar-06 11:46 
AnswerRe: add key in web config confusing. Pin
Guffa20-Mar-06 2:03
Guffa20-Mar-06 2:03 
QuestionHow To Connect to Database after Deployment Pin
WackoWolf18-Mar-06 11:57
WackoWolf18-Mar-06 11:57 
AnswerRe: How To Connect to Database after Deployment Pin
Thomas Stockwell18-Mar-06 13:48
professionalThomas Stockwell18-Mar-06 13:48 
AnswerRe: How To Connect to Database after Deployment Pin
Jorge Novo18-Mar-06 15:07
Jorge Novo18-Mar-06 15:07 
QuestionHow does the AxWebBrowser control know... Pin
Darshon18-Mar-06 11:26
Darshon18-Mar-06 11:26 
AnswerRe: How does the AxWebBrowser control know... Pin
Darshon18-Mar-06 18:53
Darshon18-Mar-06 18:53 
QuestionIPGlobalProperties class Pin
VoxBinarica18-Mar-06 11:12
VoxBinarica18-Mar-06 11:12 
I don't get it...I'm pretty new to VB.NET and programming in general and I've written this class that is supposed to get TCP statistics:
'------------------HERE IT BEGINS------------------------------------
Imports System.net
Imports System.net.NetworkInformation
Public Class TcpStats
Public stats As Long()

Public Sub ShowTcpStats(ByVal version As NetworkInterfaceComponent)
Try
Dim properties As IPGlobalProperties = IPGlobalProperties.GetIPGlobalProperties
Dim tcpstat As TcpStatistics
Select Case version
Case NetworkInterfaceComponent.IPv4
tcpstat = properties.GetTcpIPv4Statistics
Case NetworkInterfaceComponent.IPv6
tcpstat = properties.GetTcpIPv6Statistics
Case Else
Throw New ArgumentException("version")
End Select

stats(0) = tcpstat.MinimumTransmissionTimeout
stats(1) = tcpstat.MaximumTransmissionTimeout
stats(2) = tcpstat.CurrentConnections
stats(3) = tcpstat.CumulativeConnections
stats(4) = tcpstat.ConnectionsInitiated
stats(5) = tcpstat.ConnectionsAccepted
stats(6) = tcpstat.FailedConnectionAttempts
stats(7) = tcpstat.ResetConnections
stats(8) = tcpstat.SegmentsReceived
stats(9) = tcpstat.SegmentsSent
stats(10) = tcpstat.SegmentsResent

Catch ex As Exception
MsgBox(ex.Message)

End Try


End Sub
End Class
--------------------HERE IT ENDS--------------------------------
This is how i instantiate the class from the main form:
------------------- HERE IT BEGINS------------------------------
Imports System.net
Imports System.net.NetworkInformation
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Instantiating my class
Dim tcpstats As New TcpStats
'Calling the ShowTcpStats procedure in my class
tcpstats.ShowTcpStats(NetworkInterfaceComponent.IPv4)
'Here is a list into which I add the statistics
Me.lstTcpStats.Items.Add(tcpstats.stats(0))
Me.lstTcpStats.Items.Add(tcpstats.stats(1))
Me.lstTcpStats.Items.Add(tcpstats.stats(2))
'And so on....
End Sub

End Class
-------------------HERE IT ENDS----------------------------------

problem is, when I execute the program the properties object of the IPGlobalProperties class is Nothing
so i get a NullReferenceExeption.

Can anyone tell me why? What I'm doing wrong?

Kind regards V



QuestionHow to use Inheritance in VB 6.0 Pin
anant iyer18-Mar-06 10:35
anant iyer18-Mar-06 10:35 
AnswerRe: How to use Inheritance in VB 6.0 Pin
Dave Kreskowiak18-Mar-06 12:08
mveDave Kreskowiak18-Mar-06 12:08 
QuestionWindows Forms Pin
newtwales18-Mar-06 8:54
newtwales18-Mar-06 8:54 
AnswerRe: Windows Forms Pin
CWIZO18-Mar-06 9:55
CWIZO18-Mar-06 9:55 
AnswerRe: Windows Forms Pin
Dave Kreskowiak18-Mar-06 12:07
mveDave Kreskowiak18-Mar-06 12:07 
GeneralRe: Windows Forms Pin
HaloZa19-Mar-06 8:13
HaloZa19-Mar-06 8:13 
GeneralRe: Windows Forms Pin
Dave Kreskowiak19-Mar-06 12:27
mveDave Kreskowiak19-Mar-06 12:27 
QuestionThe mysterious Desktop redraw. Pin
Pascal Ganaye18-Mar-06 7:56
Pascal Ganaye18-Mar-06 7:56 
GeneralRe: The mysterious Desktop redraw. Pin
Guffa18-Mar-06 8:34
Guffa18-Mar-06 8:34 
AnswerRe: The mysterious Desktop redraw. Pin
Dave Kreskowiak18-Mar-06 8:45
mveDave Kreskowiak18-Mar-06 8:45 
QuestionSome Example to Display an image using directx Pin
MAP Tiger18-Mar-06 7:54
MAP Tiger18-Mar-06 7:54 
Questionadding icons to the menu bar Pin
kmhlanga18-Mar-06 7:03
professionalkmhlanga18-Mar-06 7:03 
AnswerRe: adding icons to the menu bar Pin
Chatura Dilan19-Mar-06 3:06
Chatura Dilan19-Mar-06 3:06 
AnswerRe: adding icons to the menu bar Pin
kmhlanga21-Mar-06 6:18
professionalkmhlanga21-Mar-06 6:18 
QuestionCrystal Report Time Duration Accumalation Pin
ensuvari18-Mar-06 5:04
ensuvari18-Mar-06 5:04 
QuestionHow to solve external exceptions error related to picturebox.image.save? Pin
JUNEYT18-Mar-06 2:57
JUNEYT18-Mar-06 2:57 
AnswerRe: How to solve external exceptions error related to picturebox.image.save? Pin
Dave Kreskowiak18-Mar-06 3:07
mveDave Kreskowiak18-Mar-06 3:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.