I am studying VB.NET and looking for way to check if application mapped to network drive. I check vb.net how to check if a network drive is mapped persistently
and i also trying to ping to network drive. However, this method seem not workinng.
I was trying ping to network drive and it was always return false.
I made function. On the function part
Public Function CheckForInternetConnection(path As String) As Boolean
Try
Using client = New WebClient()
Using stream = client.OpenRead(path)
Return True
End Using
End Using
Catch
Return False
End Try
End Function
On the running part i call this function above
CheckForInternetConnection("google.com")
CheckForInternetConnection("\\mynetowrk_Driver.com\system\application")
When i use CheckForInternetConnection with "google.com" it return "TRUE" However, when i use "\mynetowrk_Driver.com\system\application" this network drive, it return FALSE
I am not sure how i can check if netowork driver was mapped .