I have the following section declared in the webconfig file to allow impersonation , I have shared the folder to public access within the network on the other machine
<system.web>
<compilation debug="true" targetFramework="4.0" />
<authentication mode="Windows"/>
<identity impersonate="true" userName="******" password="*****"/>
.........
..........
when i run the application its throwing error saying
Configuration Error Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not create Windows user token from the credentials specified in the config file. Error from the operating system 'Logon failure: unknown user name or bad password.
Aspx page: I have sample aspx page where i have the following code to move the file from local machine to other machine in the network, which runs through impersonation
protected void Page_Load(object sender, EventArgs e)
{
File.Copy(@"C:\temp\CloudURL.txt", @"\\RemoteMachine\D$\temp\CloudURL.txt", true);
}