Public Function ConvertBinToIP(strBin As String) As String
On Error Resume Next
Dim pos As Integer, binarray, tempnetid As String, ix As Integer, x As Integer, y As Integer, z As String
strBin = strBin & "."
binarray = Split(strBin, ".")
For ix = 0 To UBound(binarray) - 1
x = 0
For y = 7 To 0 Step -1
If Mid(StrReverse(binarray(ix)), y + 1, 1) = "1" Then
x = x + BA(y)
Else
x = x
End If
Next y
z = z & CStr(x) & "."
Next ix
ConvertBinToIP = Left(z, Len(z) - 1)
End Function
On Error Resume Next
Dim pos As Integer, binarray, tempnetid As String, ix As Integer, x As Integer, y As Integer, z As String
strBin = strBin & "."
binarray = Split(strBin, ".")
For ix = 0 To UBound(binarray) - 1
x = 0
For y = 7 To 0 Step -1
If Mid(StrReverse(binarray(ix)), y + 1, 1) = "1" Then
x = x + BA(y)
Else
x = x
End If
Next y
z = z & CStr(x) & "."
Next ix
ConvertBinToIP = Left(z, Len(z) - 1)
End Function
Dim bArray() As String, tmpVal As Integer
Dim iCount As Integer, iPos As Integer
On Error Resume Next
strBin = strBin & "."
bArray = Split(strBin, ".")
For iCount = 0 To UBound(bArray) - 1
tmpVal = 0
For iPos = 1 To Len(bArray(iCount))
tmpVal = tmpVal + Val(Mid$(bArray(iCount), iPos, 1)) * (2 ^ (Len(bArray(iCount)) - iPos))
Next iPos
ConvertBinToIP = ConvertBinToIP & CStr(tmpVal) & "."
Next iCount
ConvertBinToIP = Mid$(ConvertBinToIP, 1, Len(ConvertBinToIP) - 1)
End Function