File.Move UNC

  • Thread starter Thread starter Bill Young via .NET 247
  • Start date 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
 
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
 
Back
Top