What's Here?
- Members: 340,163
- Replies: 920,586
- Topics: 154,964
- Snippets: 4,855
- Tutorials: 1,257
- Total Online: 4,049
- Members: 133
- Guests: 3,916
|
|
Submitted By:
RodgerB
|
|
Rating:
 
|
| Views: 941 |
Language: VB.NET |
| Last Modified: December 6, 2007 |
Instructions:
1) Copy and paste the function into a class.
2) Read below on how to call the function. |
Snippet
''' <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")
Copy & Paste
|
|
|
Be Social
Reference Sheets
Bye Bye Ads
Monthly Drawing
Top Contributors
Top 10 Kudos This Month
|