0

I have application c#, config file is xml file. If same computer it working is fine but not security. In this case, everyone can see and read this config file.

Can I load xml file from another computer?

XDocument doc = XDocument.Load(fileXml);
var cmds = doc.Root
              .Element("ListProfile")
              .Elements("Profile")
              .Where(b => b.Element("Id").Value == profile_id)
              .SelectMany(b => b.Element("Command").Elements())
              .Select(p => new
               {
                   Id = (int)p.Element("Id"),
                   Path = (string)p.Element("Path"),
                   Value = (string)p.Element("Value")
               });

Thanks.

Mo Patel
  • 2,321
  • 4
  • 22
  • 37

1 Answers1

0

Do you want to load your config when starting the application, or is it possible to load the config after the initial load is done. In the latter case, you would be better of using a webservice.

Also where is this second PC located? Is it inside the same LAN or somewhere else? Same as with the first point, the latter would make a webservice a better option.

Lastly, what is the security problem. If you are worried about passwords in the config, you could encrypt these passwords, and load the encrypted password from the XML, then just decrypt and see if it's correct.

  • Thank for your reply. second PC located is LAN
    Can you support me, how to using a webservice with application C#?
    – Nguyễn Văn Quang May 21 '14 at 02:39
  • If the second PC is in the same lan, both a webservice and getting the file from said PC aren't advised. Especially if you only want to do this for security reasons, since you'll send everything as plain text. You're better of just encrypting the sensitive data in your XML. You could use this: http://stackoverflow.com/questions/273452/using-aes-encryption-in-c-sharp You only need the decrypt in your application, you can make a simple second application to encrypt the sensitive data from your XML. – Speedy Codezales May 21 '14 at 10:55