Alexander Higgins
unread,Aug 1, 2007, 8:34:31 PM8/1/07Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting
Ok you need to get the IP addres of a remove computer using .net..
Humm probably not the right way to do it but here is how I would do it
(not tested but it should work). Call Arp from the commandline and
pipe the results to a text file. Then read the text file line by line
looking for the Mac address. If the IP is on the same line as the Make
address then return the IP
function getIpFromMacaddress
Dim TempFile = "C:\somefile.txt")
Dim macAddress = "0-aa-00-62-c6-09"
if io.file.exists(tempfile) then io.file.delete(tempfile)
Dim shell = createobject("wscipt.shell")
shell.run(string.format("cmd /c arp -a >> " & tempfile)
Dim sr as new io.streamreader(Tempfile)
dim s as string = sr.readtoend
sr.close
Dim lines as string = split(s, vbnewline)
for i as integer=0 to line.length-1
if line(i).indexof(macAddress) <> -1 then
return split(line, vbtab)(0).trim
end if
next
return "Ip not found"
end function
> > address ?- Hide quoted text -
>
> - Show quoted text -