How to read remote INI files

advertisements

I read INI file strings through GetPrivateProfileString API. However, the INIs in local windows directory could be read like that. How can I read and edit a INI file in a Remote machine.


I guess you're asking how to read a remote file (which is what this would boil down to). The easiest option if it's available is probably to just read the file using a remote UNC file path, e.g. \\SomeMachine\SomeShare\TheFile.ini. If you can't do that, you need to figure out a way to transfer the file to the local machine, either out of band or on demand using named pipes, TCP sockets, or something similar.

Why are you using INI files anyway? They were essentially deprecated after the 16-bit Windows era. I'd highly recommend a different approach (e.g. the registry, an XML config file, ...).