Access to the path is denied.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • memohno
    New Member
    • Mar 2010
    • 1

    Access to the path is denied.

    hi :
    when i try to rename a file i have this message
    "Access to the path is denied."
    i use the folowing code :
    Code:
    System.IO.File.Move(@"C:\memo.txt",@"C:\nana.txt");
    in this example i want to change the file name from memo to nana

    thanks
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.

    Comment

    • tlhintoq
      Recognized Expert Specialist
      • Mar 2008
      • 3532

      #3
      The command is proper. So your problem is elsewhere. Perhaps the file is open and in use by another process. Maybe the file is locked (attributes). Maybe you aren't logged in as a user with sufficient privileges.

      Comment

      Working...