Open a shared file under another user and domain?

前端 未结 3 1127
一生所求
一生所求 2020-12-06 03:47

I have a C# console application that needs to read a shared file on a machine in another domain. When the application tries to access the file an exception occurs as the loc

3条回答
  •  [愿得一人]
    2020-12-06 04:31

    From memory you'll need to use a Windows API call and login as a user on the other domain. See this link for an example.

    Another idea could be to use the RunAs command line argument to read the file and save it into a file on your local domain/server.

提交回复
热议问题