<pre>For i = 1 To 254 Try hostname = "" ipaddr = "192.168.12." & i.ToString hostname = (System.Net.Dns.GetHostEntry("192.168.12." & i.ToString).HostName.ToString) timestamp = DateAndTime.Now.ToString If hostname <> "" Then If con.State = ConnectionState.Closed Then con.Open() End If sql = "insert into ipstats values(?,?,?)" cmd = New SqlCeCommand(sql, con) cmd.Parameters.AddWithValue("hostname", hostname) cmd.Parameters.AddWithValue("ipddr", ipaddr) cmd.Parameters.AddWithValue("timestamp", timestamp) retvals = cmd.ExecuteNonQuery() End If Catch ex As Exception End Try Next
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)