VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to find the network with Ms Access code ( Visual basic )

by Dennis Middeljans (2 Submissions)
Category: OLE/COM/DCOM/Active-X
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Mon 28th January 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to find the network with Ms Access code ( Visual basic )

API Declarations


Option Explicit

Private Declare Function GetDriveType Lib "kernel32" _
Alias "GetDriveTypeA" (ByVal nDrive As String) _
As Long

Private Declare Function GetLogicalDriveStrings Lib _
"kernel32" Alias "GetLogicalDriveStringsA" _
(ByVal nBufferLength As Long, ByVal lpBuffer _
As String) As Long

Private Const DRIVE_REMOVABLE = 2
Private Const DRIVE_FIXED = 3
Private Const DRIVE_REMOTE = 4
Private Const DRIVE_CDROM = 5
Private Const DRIVE_RAMDISK = 6

Rate How to find the network with Ms Access code ( Visual basic )



  
  Dim l&, Ergebnis&, x&, typ&
  Dim Puffer$, NetwerkAll$, Netwerk$, Omschrijving$

    List1 = Null
    
    Puffer = Space(64)
    l = 64
    Ergebnis = GetLogicalDriveStrings(l, Puffer)
    NetwerkAll = Left$(Puffer, Ergebnis)
    
    Do While x < Len(Puffer)
        x = InStr(Puffer, Chr$(0))
        If x Then
            Netwerk = Left$(Puffer, x)
            Puffer = Mid$(Puffer, x + 1, Len(Puffer))
            typ = GetDriveType(Netwerk)
            If typ <> 1 Then
                Select Case typ
                    Case 2: Omschrijving = "Diskette station"
                    Case 3: Omschrijving = "Harde schijf"
                    Case 4: Omschrijving = "Netwerk"
                    Case 5: Omschrijving = "CD-ROM"
                    Case 6: Omschrijving = "RAM-Disk"
                End Select
                
                Netwerk = UCase(Mid$(Netwerk, 1, 2))
                List1 = List1 & Netwerk & " " & Omschrijving & vbCrLf
            End If
        Else
            Exit Do
        End If
    Loop
End Sub


Download this snippet    Add to My Saved Code

How to find the network with Ms Access code ( Visual basic ) Comments

No comments have been posted about How to find the network with Ms Access code ( Visual basic ). Why not be the first to post a comment about How to find the network with Ms Access code ( Visual basic ).

Post your comment

Subject:
Message:
0/1000 characters