API alternative to HOSTS file modification
C / C++ / MFC
2
Posts
2
Posters
0
Views
1
Watching
-
I'm wondering if there is an API fn to effectively perform the same as adding an entry to the HOSTS file. I seem to be drawing a blank so far with my google and msdn search attempts. Cheers, Phil
-
I'm wondering if there is an API fn to effectively perform the same as adding an entry to the HOSTS file. I seem to be drawing a blank so far with my google and msdn search attempts. Cheers, Phil
It's just a text file. Would the normal file I/O functions not suffice?
CStdioFile file; file.Open("hosts", CFile::modeWrite); file.SeekToEnd(); file.WriteString("127.0.0.1 www.aadserver.net\n"); file.Close();