Remote Copy using Asp.net and C#

G

Guest

Hi
I have an ASp.net application using C#. I need to copy a file present on the web server machine to a remote machine on the network. Although this seems to be a trivial matter I am having difficulties copying the exe

I am Trying

string Source = @"c:\temp\test.exe"
string Destination = @"Z:\test.exe"

File.Copy(Source, Destination, true)

Z: is mapped to the Remote machine network drive. I am able to physically copy files to this drive from the Web Server machine, but when I try from ASp.net, I get the following erro

System.Io.Exception: Logon Failure: unknown user name or bad passwor

I think it has to do with the Web Server using the ASPNET user , which does not have the right credentials on the remote machine. I do not know how to solve this issue

I tried using WMI too, I was able to copy files from one directory to another directory on the remote machine, but not from the Web Server machine to Remote machine

Any help in this matter is appreciated

Regards
PR
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top