System.IO.FileNotFoundException using file.copy

Discussion in 'ASP .Net Security' started by Stephen Witter, May 27, 2004.

  1. I am trying to copy a file to a network drive. I can do it on the
    domain controller/web server but not from a client. Here is the code:

    Dim impersonationContext As
    System.Security.Principal.WindowsImpersonationContext
    Dim currentWindowsIdentity As System.Security.Principal.WindowsIdentity
    currentWindowsIdentity =
    CType(User.Identity,System.Security.Principal.WindowsIdentity)
    impersonationContext = currentWindowsIdentity.Impersonate()
    dim Temp as string="TestFile"
    File.Copy("\\MyServer\Template.doc", "\\MyServer\" & Temp &".doc")

    impersonationContext.Undo()

    I get the error "System.IO.FileNotFoundException: Could not find file
    \\Server\File..." when running it from the [authenticated] client
    browser. I searched everywhere on the web and MSDN on this error but found
    nothing. The error it occurs on the file copy statement The file.copy
    statement is trying to copy a file on a different server than the web
    server.

    Any help is appreciated.
     
    Stephen Witter, May 27, 2004
    #1
    1. Advertising

  2. Stephen Witter

    She Ven Ng Guest

    I also facing the same problem. Did u manager to solve ur problem? If
    yes, can u pls post ur solution?
    Thanks.

    *** Sent via Devdex http://www.devdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    She Ven Ng, Jun 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Brian
    Replies:
    1
    Views:
    3,280
    Rick Strahl [MVP]
    Dec 5, 2003
  2. Stephen Witter
    Replies:
    2
    Views:
    5,470
    Stephen Witter
    May 28, 2004
  3. msnews.microsoft.com

    System.IO.FileNotFoundException help

    msnews.microsoft.com, Jun 3, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,224
    msnews.microsoft.com
    Jun 3, 2004
  4. Martinh
    Replies:
    0
    Views:
    2,783
    Martinh
    Aug 15, 2004
  5. =?Utf-8?B?UmFqYQ==?=
    Replies:
    2
    Views:
    828
    bruce barker
    Sep 24, 2004
Loading...

Share This Page