Thanks Jawad,I dont want to do it run time so i just tried to give the rights to the aspnet account.
First i included the aspnet in the admins group but no success.i was still not able to write any files on other machine in the network.
Then i changed the web config file with this information
<system.web>
<
identity
impersonate="false"
userName="domainname\username"
password="password" />
</syetem.web>
but still its saying that access to the path is denied but using this username and password i can access the network machine.
Also i tried to check the value for user.identity.name but its not showing me anything.
Any help on this pls
if this post helped you then pls mark this as Answer.