IsNetworkDrive
This function returns a boolean value according to whether a drive is a network drive or not.
VB.NET
''' <summary>
''' Determines whether a drive is a network drive or not.
''' </summary>
''' <param name="driveLetter">The letter of the drive, e.g "c".</param>
''' <returns>True if the drive is a network drive, False otherwise.</returns>
''' <remarks></remarks>
Public Shared Function IsNetworkDrive(ByRef driveLetter As String) As Boolean
Dim driveInfo As System.IO.DriveInfo, driveType As System.IO.DriveType
driveInfo = My.Computer.FileSystem.GetDriveInfo(driveLetter)
driveType = driveInfo.DriveType
If driveType = IO.DriveType.Network Then Return True
Return False
End Function
' How to call the function:
Dim boolNetworkDrive As Boolean = IsNetworkDrive("c")
See Also
- </DIC> Submission - http://www.dreamincode.net/code/snippet1510.htm
page_revision: 0, last_edited: 1197781668|%e %b %Y, %H:%M %Z (%O ago)





