A program I didn't write needs to have access to a remote file. It has all the information it needs: path and the login information to the other computer. However, when it tries to access it, the login information isn't used at all, so the read/write always fails.
If you try to access the computer outside of the program (and logging in) before using the function, everything works fine. I don't want to have to force that on the user though, so I want to make a small function that will effectively do that. Hopefully something that can pretty much stand on its own since I don't want to alter all the code that I'm unfamiliar with.
But I tried the following based off of MS examples and got the error "Invalid Namespace." Does anybody know of any other quick solutions?
ConnectionOptions options = new ConnectionOptions();
options.username = "user";
options.password = "pass";
Management scope = new ManagementScope("\\\\server\\folder", options);
scope.Connect(); // ManagementException ("Invalid Namespace") thrown here
If you try to access the computer outside of the program (and logging in) before using the function, everything works fine. I don't want to have to force that on the user though, so I want to make a small function that will effectively do that. Hopefully something that can pretty much stand on its own since I don't want to alter all the code that I'm unfamiliar with.
But I tried the following based off of MS examples and got the error "Invalid Namespace." Does anybody know of any other quick solutions?
ConnectionOptions options = new ConnectionOptions();
options.username = "user";
options.password = "pass";
Management scope = new ManagementScope("\\\\server\\folder", options);
scope.Connect(); // ManagementException ("Invalid Namespace") thrown here