Click here to Skip to main content
15,904,638 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralGet the binary content from a VC dll. Pin
rushing17-Aug-05 19:44
rushing17-Aug-05 19:44 
GeneralCreating an sql adapter,datatable and populating the fields of a grid Pin
mcupryk17-Aug-05 17:19
mcupryk17-Aug-05 17:19 
GeneralRe: Creating an sql adapter,datatable and populating the fields of a grid Pin
Christian Graus17-Aug-05 17:52
protectorChristian Graus17-Aug-05 17:52 
GeneralRe: Creating an sql adapter,datatable and populating the fields of a grid Pin
Anonymous17-Aug-05 19:20
Anonymous17-Aug-05 19:20 
GeneralRe: Creating an sql adapter,datatable and populating the fields of a grid Pin
Christian Graus18-Aug-05 14:49
protectorChristian Graus18-Aug-05 14:49 
QuestionGet list of machines in LAN? Pin
Jimmy Huynh17-Aug-05 16:46
Jimmy Huynh17-Aug-05 16:46 
AnswerRe: Get list of machines in LAN? Pin
Mohamad Al Husseiny17-Aug-05 16:50
Mohamad Al Husseiny17-Aug-05 16:50 
AnswerRe: Get list of machines in LAN? Pin
Steve Pullan17-Aug-05 17:26
Steve Pullan17-Aug-05 17:26 
Depends on what you want to achieve, but I have used this VB.NET code to query Active Directory. You will need to modify it for your purposes. Lookup the help on the objects shown here for examples of what they can provide.

Imports System.DirectoryServices

Private Sub ScanMachines()
        '
        ' Get the list of machine names in the current domain
        ' as specified by txtMachineSpec.
        '
        Dim ds As New DirectorySearcher
        ds.SearchRoot = New DirectoryEntry

        Dim wildcards() As String = Split(txtMachineSpec.Text.ToUpper, ",")
        ds.Filter = GetFilterString(wildcards)

        ds.PropertyNamesOnly = True
        ds.PropertiesToLoad.Add("name")
        ds.Sort = New SortOption("name", SortDirection.Ascending)
        ds.PageSize = 9999

        Dim src As SearchResultCollection

        Try
            '
            ' Enumerate the machines in AD.
            '
            src = ds.FindAll()

            Try
                For Each sr As SearchResult In src
                    '
                    ' Get the machine name, stripping off the "CN=" portion
                    ' as we go.
                    '
                    Dim de As DirectoryEntry = sr.GetDirectoryEntry()
                    Dim machineName As String = Replace(de.Name, "CN=", "", 1, 1)

                    '
                    ' Do your stuff here ...
                    '

                Next

            Catch ex As Exception
                MessageBox.Show("1: " & ex.Message)

            End Try

        Catch ex As InvalidOperationException
            MessageBox.Show("2: " & ex.Message)

        Catch ex As NotSupportedException
            MessageBox.Show("3: " & ex.Message)

        Catch ex As Exception
            MessageBox.Show("4: " & ex.Message)

        Finally

            If Not src Is Nothing Then
                src.Dispose()
            End If

            If Not ds Is Nothing Then
                ds.Dispose()
            End If

        End Try

    End Sub


...Steve
AnswerRe: Get list of machines in LAN? Pin
Anonymous17-Aug-05 17:54
Anonymous17-Aug-05 17:54 
GeneralCalendar control in Access forms Pin
Anonymous17-Aug-05 12:43
Anonymous17-Aug-05 12:43 
GeneralRe: Calendar control in Access forms Pin
Anonymous17-Aug-05 12:44
Anonymous17-Aug-05 12:44 
GeneralUsing IS in Select Case Pin
dotnetCarpenter17-Aug-05 10:02
dotnetCarpenter17-Aug-05 10:02 
GeneralRe: Using IS in Select Case Pin
Steve Pullan17-Aug-05 15:00
Steve Pullan17-Aug-05 15:00 
GeneralRe: Using IS in Select Case Pin
dotnetCarpenter22-Aug-05 4:26
dotnetCarpenter22-Aug-05 4:26 
GeneralPrinting Array of Bytes to File Pin
ChemmieBro17-Aug-05 7:55
ChemmieBro17-Aug-05 7:55 
GeneralRe: Printing Array of Bytes to File Pin
BammBamm17-Aug-05 8:49
BammBamm17-Aug-05 8:49 
Generalftp Pin
17-Aug-05 7:54
suss17-Aug-05 7:54 
GeneralRe: ftp Pin
Mohamad Al Husseiny17-Aug-05 16:55
Mohamad Al Husseiny17-Aug-05 16:55 
GeneralVBA call to a vb.net dll Pin
FlyngTiger17-Aug-05 7:01
FlyngTiger17-Aug-05 7:01 
GeneralRe: VBA call to a vb.net dll Pin
Anonymous17-Aug-05 7:09
Anonymous17-Aug-05 7:09 
GeneralRe: VBA call to a vb.net dll Pin
FlyngTiger17-Aug-05 7:12
FlyngTiger17-Aug-05 7:12 
GeneralSimple Syntax Issue Pin
Capilano17-Aug-05 5:11
Capilano17-Aug-05 5:11 
GeneralRe: Simple Syntax Issue Pin
Dave Kreskowiak17-Aug-05 5:31
mveDave Kreskowiak17-Aug-05 5:31 
GeneralRe: Simple Syntax Issue Pin
Capilano17-Aug-05 6:46
Capilano17-Aug-05 6:46 
GeneralRe: Simple Syntax Issue Pin
Anonymous17-Aug-05 7:05
Anonymous17-Aug-05 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.