TheCreepySheep TheCreepySheep - 6 months ago 23
Vb.net Question

Adding value to integer in VB.NET

How do I add +1 value to an integer?

Something like

Do
If myClientMachineIP.AddressFamily = Sockets.AddressFamily.InterNetwork Then
Label2.Text = myClientMachineIP.ToString()
Else
TextBox2.Text = "IP is not equal to IPv4"
proov = +1
TextBox3.Text = proov
End If
Loop Until proov = 10


How do I add +1 to the
proov
integer variable?

Tim Tim
Answer

CORRECTION

VB.NET does not have the increment operator (++), so the simplest way would be to use the addition assignment operator += Operator:

proov += 1

Another way is to explicitly add 1 to the value:

proov = proov + 1