Hi,
i am trying to connect to a non domain server that has a folder shared.
i am getting
I know the user and password are correct
Any ideas?
i am trying to connect to a non domain server that has a folder shared.
i am getting
I know the user and password are correct
Any ideas?
Code:
IntPtr token;
WindowsIdentity wi;
//if (LogonUser ("<user name with network share access>", "<domain name>", "<user password>", 8, // LOGON32_LOGON_NETWORK_CLEARTEXT 0, // LOGON32_PROVIDER_DEFAULT out token))
if (LogonUser(@"fluency", @"\\flcy_fluency", "password", 8, 0, out token))
{
wi = new WindowsIdentity (token);
WindowsImpersonationContext wic = wi.Impersonate ();
StreamWriter sw = File.AppendText(@"\\flcy_fluency\DNC_Lists\TenantDNC.txt");
sw.WriteLine(tbTel1.Text);
sw.Close();
wic.Undo ();
CloseHandle (token);
}
Comment