Voisinnage reseau

farradjs Messages postés 73 Date d'inscription lundi 17 novembre 2003 Statut Membre Dernière intervention 16 mars 2009 - 24 janv. 2007 à 18:12
ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 - 31 janv. 2007 à 14:37
Salut, y a t il une personne qui peuve me dire comment avoir une liste de tout les ordinateur presnts sous le reseau local
merci a vous tous
sss

3 réponses

cs_Exploreur Messages postés 4821 Date d'inscription lundi 11 novembre 2002 Statut Membre Dernière intervention 15 novembre 2016 15
24 janv. 2007 à 20:19
Salut,

En Vb.net voir ici
En Vb6 voir ici

Pour le reste ou quelque chose de plus précis , fait la recherche.....

A+
Exploreur
0
farradjs Messages postés 73 Date d'inscription lundi 17 novembre 2003 Statut Membre Dernière intervention 16 mars 2009
26 janv. 2007 à 15:42
merci pour m avoir repondu, mais la source je connait la source que vous m avez montrer mais comment lister les ordinateurs des autres domaines (sous vb.net)

sss
0
ShareVB Messages postés 2676 Date d'inscription vendredi 28 juin 2002 Statut Membre Dernière intervention 13 janvier 2016 26
31 janv. 2007 à 14:37
salut,

quelque chose comme :
    Private Const MAX_PREFERRED_LENGTH As Integer = -1
    Private Const ERROR_MORE_DATA As Integer = 234
    Private Const SV_TYPE_WORKSTATION As Integer = &H1
    Private Const NERR_Success As Integer = 0

    Private Structure SERVER_INFO_100
        Public sv100_platform_id As Integer
        <MarshalAs(UnmanagedType.LPWStr)> _
        Public sv100_name As String
    End Structure

    Private Structure WKSTA_USER_INFO_1
        <MarshalAs(UnmanagedType.LPWStr)> _
        Public wkui1_username As String
        <MarshalAs(UnmanagedType.LPWStr)> _
        Public wkui1_logon_domain As String
        <MarshalAs(UnmanagedType.LPWStr)> _
        Public wkui1_oth_domains As String
        <MarshalAs(UnmanagedType.LPWStr)> _
        Public wkui1_logon_server As String
    End Structure

    Private Declare Unicode Function NetApiBufferFree Lib "netapi32" ( _
      ByVal Buffer As IntPtr _
    ) As Integer

    Private Declare Unicode Function NetServerEnum Lib "netapi32" ( _
      ByVal servername As IntPtr, _
      ByVal level As Integer, _
      ByRef bufptr As IntPtr, _
      ByVal prefmaxlen As Integer, _
      ByRef entriesread As Integer, _
      ByRef totalentries As Integer, _
      ByVal servertype As Integer, _
      ByVal domain As String, _
      ByVal resume_handle As Integer _
    ) As Integer

    Private Function GetWorkstations(byval domain as string) As ArrayList
        Dim res As ArrayList = New ArrayList()
        Dim buff, ptr As IntPtr
        Dim entriesread, totalentries As Integer
        Dim i, ret As Integer
        Dim entry As SERVER_INFO_100 = Nothing

        ret = NetServerEnum(IntPtr.Zero, 100, buff, MAX_PREFERRED_LENGTH, entriesread, totalentries, SV_TYPE_WORKSTATION, domain, 0)
        If ret = NERR_Success Then
            ptr = buff
            For i = 0 To entriesread - 1
                Marshal.PtrToStructure(ptr, entry)
                res.Add(entry)
                ptr = New IntPtr(ptr.ToInt32() + Marshal.SizeOf(entry))
            Next
            NetApiBufferFree(buff)
        End If

        Return res
    End Function

ShareVB
0
Rejoignez-nous