"jbrave" wrote:
if anyone is interested, here is a little code for grabbing an ipaddress from roDeviceInfo.
function getrokulocalip() as string
di=createobject("rodeviceinfo")
while true
temp=di.getipaddrs()
temp.reset()
aakey=temp.next()
if not temp=invalid then
return temp[aakey]
end if
end while
end function
Hrmm.. that doesn't look quite right. You're resetting temp on every loop through that while, so the .Next() is never actually going to get you anywhere. That aside, with an associative array, you can do a "For Each" through the keys in the aa instead of the "While" loop...
Function GetRokuLocalIP() As String
deviceInfo = CreateObject("roDeviceInfo")
ipAddresses = deviceInfo .GetIPAddrs()
For Each key In ipAddresses
ipAddress = ipAddresses[key]
If ipAddress <> invalid And ipAddress.Len() > 0 Then
Return ipAddress
End If
Next
Return ""
End Function
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)