PoppapumpJ
Programmer
Hey, I have a property that I want to store the network IP address in. I Would like to pass in the client's IP addres and truncate off the last ".XXX"
I put some formatting statements into the set area of the property but it keeps setting and returning the value passed in instead of my formatted value
it looks like this:
private mvarIPAddress as string
Public Property IpAddress() As String
Get
IpAddress = mvarIPAddress
End Get
Set(ByVal Value As String)
'Truncate Local IP to Network IP
Dim intLastDot As Integer
Dim intAmountToKeep As Integer
intLastDot = InStr(Value, "."
intAmountToKeep += intLastDot
intLastDot = InStr(Right(Value, Len(Value) - intLastDot), "."
intAmountToKeep += intLastDot
intLastDot = InStr(Right(Value, Len(Value) - intLastDot), "."
intAmountToKeep += intLastDot
mvarIPAddress = Left(Value, intAmountToKeep + 1)
End Set
End Property
I put some formatting statements into the set area of the property but it keeps setting and returning the value passed in instead of my formatted value
it looks like this:
private mvarIPAddress as string
Public Property IpAddress() As String
Get
IpAddress = mvarIPAddress
End Get
Set(ByVal Value As String)
'Truncate Local IP to Network IP
Dim intLastDot As Integer
Dim intAmountToKeep As Integer
intLastDot = InStr(Value, "."
intAmountToKeep += intLastDot
intLastDot = InStr(Right(Value, Len(Value) - intLastDot), "."
intAmountToKeep += intLastDot
intLastDot = InStr(Right(Value, Len(Value) - intLastDot), "."
intAmountToKeep += intLastDot
mvarIPAddress = Left(Value, intAmountToKeep + 1)
End Set
End Property