New topic: 

Computers on network

<http://forums.realsoftware.com/viewtopic.php?t=3713>

       Page 1 of 1
   [ 11 posts ]                 Previous topic | Next topic         Author  
Message       harrytheshark           Post subject: Computers on networkPosted: 
Thu Mar 23, 2006 3:26 pm                        
Joined: Thu Oct 20, 2005 1:13 pm
Posts: 169              would code would i use if i wanted to display the ip 
adresses of all the computers connected to my network in a listbox 
 
Thanks 
 
Tom   
                            Top               Aaron Ballman           Post 
subject: Posted: Fri Mar 24, 2006 9:26 pm                               
Joined: Wed Sep 28, 2005 8:39 am
Posts: 9258
Location: Riverside, CA              Not certain it's possible -- that depends 
entirely on your router and whether it has an API to tell you that information. 
    
_________________
* Check out my blog at http://ramblings.aaronballman.com. 
* RBLibrary.com  REALbasic learning at the speed of now! 
* Get the WFS, everybody's using it.  
                            Top                Pariahware           Post 
subject: Re: Computers on networkPosted: Sat Mar 25, 2006 12:48 am              
                 
Joined: Fri Sep 30, 2005 10:00 am
Posts: 950
Location: Raleigh, NC              harrytheshark wrote:would code would i use 
if i wanted to display the ip adresses of all the computers connected to my 
network in a listbox
 
 
 
I have an old VB6 project that somehow queries the machines on the network.  I 
just tested it in my 2 Mac & 1 PC environment and it gave me entries, but 
nothing specific. 
 
I would suggest using shell commands and pinging your subnet (192.168.1.x) 
where x is 0 through 255.  If the shell returns a positive, add that IP to your 
listbox.     
_________________
Christian
Pariahware, Inc.
Mac, Windows, Linux, & iPhone Consulting
[email protected]
http://www.pariahware.com/

The Association of REALbasic Professionals
http://www.arbp.org/
--
God loved you so much that He gave His only son Jesus.  What have you done with 
God's gift?  
                            Top               Kevin           Post subject: 
Posted: Fri Apr 14, 2006 8:54 am                        
Joined: Mon Oct 10, 2005 6:23 pm
Posts: 147              Okay, a few questions. 
 
 
1.  Is this a Windows NT Active Directory or NT Lan Manager Network? 
2.  Is this a LDAP supported network? 
3.  Is this a Yellow Pages Supported Network? 
 
If it supports LDAP of any kind and you are using Windows just port the 
following VB 6.0 to RB. 
 
Code:
Private Sub RefreshComputers
  Dim oInfo As ActiveDs.WinNTSystemInfo
  Dim oAD   As ActiveDs.IADs
  
  Set oInfo = New ActiveDs.WinNTSystemInfo
  Set oAD = GetObject("WinNT://" & oInfo.DomainName)
  oAD.Filter = Array("Computer")
  
  Dim oComputer As ActiveDs.IADsComputer
  
  For Each oComputer In oAD
    'Your code here
  Next
  End Sub
  
 
 
This is a "WinNT" query the same thing can be done using a "LDAP" query.  Sorry 
I do not have time to look it up.  Then ActiveDS is the Active Directory 
Services Type Library.     
_________________
Using: Linux Standard Edition,  
                            Top               Kevin           Post subject: 
Posted: Fri Apr 14, 2006 8:57 am                        
Joined: Mon Oct 10, 2005 6:23 pm
Posts: 147              Just a note for Linux and *nix system there  are Apache 
LDAP facilities.  I have only used them one time years ago.  The protocol was 
called OpenLDAP you can probally find a significant amount of information on it 
by searching Google or you prefered search engine.  
 
 
Kevin     
_________________
Using: Linux Standard Edition,  
                            Top               Kevin           Post subject: 
Posted: Fri Apr 14, 2006 9:04 am                        
Joined: Mon Oct 10, 2005 6:23 pm
Posts: 147              LDAP Example Query Get all Users: 
 
Code:
Aquire the "Domain" LDAP identifier (VBS Example):
oRoot = GetObject("LDAP://rootDSE")
sDomain = oRoot.Get("defaultNamingContext")

oDomain = GetObject("LDAP://" & sDomain)

sADSIBase = "<" & oADSIDomain.ADsPath & ">"

sADSIFilter ="(&(objectCategory=person)(objectClass=user)(SAMAccountName=" & 
"kevin" & "))"
sADSIAttribs = "name,SAMAccountName"
sADSIDepth = "subTree"

sADSIQuery = sADSIBase & ";" & sADSIFilter & ";" & sADSIAttribs & ";" & 
sADSIDepth

 
 
Your mileage may vary since this in Windows and I cannot seem to locate the 
Linux code.  
 
Kevin     
_________________
Using: Linux Standard Edition,  
                            Top               Scott Pawluk           Post 
subject: Posted: Tue Apr 18, 2006 1:39 pm                        
Joined: Fri Sep 30, 2005 9:18 am
Posts: 239
Location: Winnipeg, Manitoba, Canada              Some food for thought: 
 
On a "non-managed" network such as your typical home network or peer-to-peer 
network, where you don't have a central server providing authentication 
services, you should also keep in mind that with the "ping the subnet" method, 
should the workstations have a software or OS-level firewall configured, they 
may not respond to pings. 
 
For example, in my home network, I have 6 devices. Of those, only 1 device 
would respond to a ping (my print server). The 3 workstations all have their 
software firewalls configured to not allow any incoming connections. They also 
don't respond to ICMP queries (ie ping, traceroute, etc). My router is 
configured to not respond to pings. And my NAS device is also configured to not 
respond to pings. 
 
Just something to consider.     
_________________
REALbasic 2006r3 Pro, Win XP Home SP2 
Pentium4-2.6Ghz, 1 GB RAM  
                            Top               harrytheshark           Post 
subject: Posted: Wed Apr 19, 2006 11:11 am                        
Joined: Thu Oct 20, 2005 1:13 pm
Posts: 169              Kevin wrote:Okay, a few questions.  


1.  Is this a Windows NT Active Directory or NT Lan Manager Network?
2.  Is this a LDAP supported network?
3.  Is this a Yellow Pages Supported Network?

If it supports LDAP of any kind and you are using Windows just port the 
following VB 6.0 to RB.

Code:
Private Sub RefreshComputers
  Dim oInfo As ActiveDs.WinNTSystemInfo
  Dim oAD   As ActiveDs.IADs
  
  Set oInfo = New ActiveDs.WinNTSystemInfo
  Set oAD = GetObject("WinNT://" & oInfo.DomainName)
  oAD.Filter = Array("Computer")
  
  Dim oComputer As ActiveDs.IADsComputer
  
  For Each oComputer In oAD
    'Your code here
  Next
  End Sub
  


This is a "WinNT" query the same thing can be done using a "LDAP" query.  Sorry 
I do not have time to look it up.  Then ActiveDS is the Active Directory 
Services Type Library. 
 
I am running mac os x   
                            Top               louiscastoria           Post 
subject: Posted: Wed Apr 19, 2006 11:56 am                               
Joined: Mon Jan 23, 2006 4:57 pm
Posts: 65              you could connect to ports 445, 138 or 139.  Those are 
all smb/cifs ports.  445 is used for win2k and above.  This would be a better 
option than a ping.   
                            Top               Kevin           Post subject: 
Posted: Tue Apr 25, 2006 8:33 am                        
Joined: Mon Oct 10, 2005 6:23 pm
Posts: 147              Apple OS X supports LDAP (OpenLDAP) a Open Source 
project. Sorry, I cannot supply more information I have not explored LDAP on 
Apple platforms other than wondering if it was present.  The WinNT:// directive 
is a operating system specific extension to the LDAP protcol. Many operating 
systems supply simular API's extensions sicne their specific network 
constuction does not fit well into the LDAP paradyme.  I do not normally use 
LDAP for my queries since Linux and Windows directly supports NIS (Windows via 
SFU).  I do not use RB on Windows but prefer to utilize Visal Basic 6.x (Since 
it can create reuseable library components (DLL's)).  I only use the 
non-professional Linux version to write cluster utilities and inteface with 
PVM.     
_________________
Using: Linux Standard Edition,  
                            Top               shaggymac           Post subject: 
Re: Computers on networkPosted: Tue May 12, 2009 10:14 am                       
 
Joined: Fri Feb 29, 2008 5:25 pm
Posts: 266              good stuff     
_________________
http://www.shaggytalk.com
Free calls to USA & Canada
Free calls to Europe or Asia
Free calls to Puerto Rico
Plans starting at $14.95  
                            Top            Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 11 posts ]     

-- 
Over 900 classes with 18000 functions in one REALbasic plug-in. 
The Monkeybread Software Realbasic Plugin v8.1. 

&lt;http://www.monkeybreadsoftware.de/realbasic/plugins.shtml&gt;

[email protected]

Reply via email to