File.Move() using different credentials?

Discussion in 'ASP .Net' started by Andy Klare, Nov 30, 2006.

  1. Andy Klare

    Andy Klare Guest

    I am looking for a way to copy a file from a local drive on the server to a
    network share but I need to authenticate as a user that has access to the
    network share. How can I tie a different set of credentials to the
    File.Move()? I can add an Impersonate tag with domain,Username, and
    Password to the web.config to get the code to work on my machine as myself
    but I think I will have problems when I deploy to a server that does not
    have my account as an administrator on it. I would like to simply build a
    NetworkCredential object and tie it to the File.Move() call but that does
    not appear to be an option.

    Does anyone have a example of this? It seems like a fairly simple task but
    I am not finding much.

    Any ideas would be most appriciated.
    Thanks,
    Andy
    Andy Klare, Nov 30, 2006
    #1
    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. Jørn A.
    Replies:
    3
    Views:
    5,631
    Scott Allen
    Sep 10, 2004
  2. Yahya

    With different credentials.

    Yahya, Apr 4, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    463
    Steve C. Orr [MVP, MCSD]
    Apr 4, 2005
  3. Eigh
    Replies:
    2
    Views:
    800
  4. Eduardo78
    Replies:
    0
    Views:
    245
    Eduardo78
    Nov 3, 2005
  5. Andrew Tomazos
    Replies:
    2
    Views:
    611
    Nobody
    Dec 12, 2011
Loading...

Share This Page