I have the simplest problem, but after a day i still cant figure it out. SO be warned the solution may be a tad embarrassing on my part.
All i am trying to do is read and write files to a shared folder on a network in visual basic (VS 2010). I can go to the folder through windows without a problem and without being prompted for a password. However when i try to do it through visual basic, it cant find the directory. Here is my small snippet of code that i (hope) is telling me that the program cannot connect to the folder.
If Not My.Computer.FileSystem.DirectoryExists("Z:\_Cannon") Then
StatusStrip.Text = "Cannot Connect to Network"
Con = False
MsgBox("Cannot Connect to Network. Test results will not be saved")
Else : Con = True
End If
I really am astounded this is taking me so long to figure out. Are there any known issues with VS 2010 that may cause this? Maybe something else in my code that could have an effect? This is in my form_load event though, so it is literally one of the first things that runs.
Any help would be greatly appreciated. Thanks!
I had a similar issue, from what I can recall the drive mapping only works for the current user and c#’ won’t work, best sollution is to give it the full path
\\computername\_Cannon