My question is - how to clear variable in code?
I don't want to declare different variables for all my functions...
I've got 20 functions, that are running in application everytime i run it.
In every function i'm using the same variable.
My code read from registry values of keys. Everything is ok, but:
1) function is running and reading from registry (key exist)
2) next reading (key doesn't exist, but code take value from previous
function...)
It must clear, because declaration dwValue = 0 gives me "disable" value of a
key...
Function TcpMaxConnectResponseRetransmissions(ByVal strKomputer As String)
dim oreg
Dim dwValue
oreg = GetObject("winmgmts:{impersonationLevel=impersonate}!\" &
strKomputer & "\root\defaulttdRegProv")
Dim vTcpMaxConnectResponseRetransmissions
Dim strKeyPath = "System\CurrentControlSet\Services\Tcpip\parameters"
Dim strValueName = "TcpMaxConnectResponseRetransmissions"
oreg.getdwordValue(HKEYLOCALMACHINE, strKeyPath, strValueName, dwValue)
If dwValue.ToString = Nothing Then
vTcpMaxConnectResponseRetransmissions = "Brak"
ElseIf dwValue = 1 Then
vTcpMaxConnectResponseRetransmissions = "Enabled"
ElseIf dwValue = 0 Then
vTcpMaxConnectResponseRetransmissions = "Brak"
End If
Return vTcpMaxConnectResponseRetransmissions
End Function
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).