I want to access path with following code however, it throws and error
IOException: The user name or password is incorrect
System.IO.FileStream.OpenHandle(FileMode mode, FileShare share, FileOptions
options)
I use the following code
var filePath = "\\\\172.x.x.x\\UploadFolder";
using (var stream = new FileStream(filePath, FileMode.Create)
{
await files.First().CopyToAsync(stream);
}
How can I setup user name and password in this case?
EDIT:
as from the comment below I have searched and try again with this method:
bool returnValue = LogonUser("TestDomain\\testAccount", "172.x.x.x", "testPassword",
LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,
out safeTokenHandle);
// I've tried both TestDomain\\testAccount and TestDomain/testAccount
it's always return false. when I test it with my computer it's return true though.
bool returnValue = LogonUser("admin", "127.0.0.1", "password",
LOGON32_LOGON_INTERACTIVE, LOGON32_PROVIDER_DEFAULT,
out safeTokenHandle);
Is the problem happens because of domain server or something?