File.Move UNC

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bill Young via .NET 247

    #1

    File.Move UNC

    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>\<sha re> and I tried mapping a drive but I still get the same error.

    System.Unauthor izedAccessExcep tion: Access to the path "M:\home.wa v" is denied.
    at System.IO.__Err or.WinIOError(I nt32 errorCode, String str)
    at System.IO.File. Move(String sourceFileName, String destFileName)
    at WatchFolder.For m1.ProtectandSe rve(String fp) in c:\files\c#\vmw atcher\form1.cs :line 147

    line 147 is

    File.Move(fp,sp );

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



    --------------------------------
    From: Bill Young

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>tYTLyk4+F0O lo8XWQ4Un0A==</Id>
  • Cos Callis

    #2
    RE: File.Move UNC

    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

    Comment

    • Cos Callis

      #3
      RE: File.Move UNC

      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

      Comment

      Working...