File.Move UNC

  • Thread starter Bill Young via .NET 247
  • Start date
B

Bill Young via .NET 247

I'm having all sorts of problems trying to move a file across the network using the File.Move command with a computer on the network. I have tried doing it with \\<server>\<share> and I tried mapping a drive but I still get the same error.

System.UnauthorizedAccessException: Access to the path "M:\home.wav" is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String str)
at System.IO.File.Move(String sourceFileName, String destFileName)
at WatchFolder.Form1.ProtectandServe(String fp) in c:\files\c#\vmwatcher\form1.cs:line 147

line 147 is

File.Move(fp,sp);

where fp =c:\wavs\home.wav
and
sp = m:\home.wav or
\\w2k3\messages\home.wav
 
G

Guest

Bill
What "user context" is the application running in? Is this an ASP.NET application? You are running into a permissions issue (duh, I know.) but the hard part is figuiring out what permissions need to be granted and to whom. You might try authentication.assert but this carries some consequences for security as well..

HTH

Cos Callis, MCAD
 

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

Top