I have some code working that uses the API WNetAddConnection2. The code is
used from a Windows Form and on my PC it works. If I package the code and
deploy to a server the code fails with an error
"The following exception has occured: Unable to connect network drive. Win32
error code is: 67 (The network name cannot be found.)"
This is when I am logged on as the administrator of the local machine. I
thought it might be the fact I am not authenticated by a domain (whereas on
my PC I am). However, if on that machine I do a simple Start\Run and enter
the exact same IP\Share name I get prompted for the Username / password.
When entered as per the WNetAddConnection2 parameters I can see the files
without problem.
So, I am really getting stuck for ideas.
PS I did try this a few days back as a Windows Service and had "other"
problems, hence why it's now a Windows Forms exe.