how to access to a windows share with credential (VB.NET)?
alessandro belli
131
Reputation points
I need to access from my code in VB.net (framework 4.5) to a network smb share on an external domain that require authentication with windows credential.
I've tryed with a code like this
Dim theNetworkCredential = New System.Net.NetworkCredential(My.Settings.username, My.Settings.password)
Dim theNetcache = New CredentialCache
Dim urx As New Uri("\\192.168.6.5\myshare")
theNetcache.Add(urx, "Basic", theNetworkCredential)
Dim theFolders() As String = System.IO.Directory.GetDirectories(My.Settings.share)
but It fail with "unknow user or wrong password"
Any Idea?
Thank you
Alex