0

I have a text file that I need to read from another computer. This is how I try to get the data:

 if (!File.Exists(filePath))
 {
       string text = File.ReadAllText(filePath);
       MessageBox.Show(filePath);
 }

but when I do so, I get this error:

Additional information: The user name or password is incorrect.

I know the username and password but how do I place it make it so that I can put in the network credentials as well?

Ibanez1408
  • 4,550
  • 10
  • 59
  • 110
  • 3
    Possible duplicate of [How to provide user name and password when connecting to a network share](https://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a-network-share) – Jonas W Apr 10 '19 at 09:06
  • Don't instead make folder shared so you can use windows credentials and not need to use a username and password. You will be able to access the file provided a group account is setup so user(s) have account on both local and remote PCs. Most companies use Group Policies so every employee has access to all PC in the company and have access to Network Drives. Making the folder shared it will look like a Network Drive. – jdweng Apr 10 '19 at 09:48

0 Answers0