I’m trying to modify the hosts file ( so i add the lines to it ) , host file which is on c:\windows\system32\drivers\etc\
I’ve added a dataGridView with two columns in my form ( URL and RedirectTo ), now it looks something like this :

what i want to do is to read the current value of dataGrid and append them to a the hosts file, so the text file will look like this :
![enter image description here][2]
How to access the columns values and read them in order to append them to the hosts file ( End of file ) in the following format :
www.algerie-actualites.com www.monde-presse.com
algerie-actudz.com/ www.monde-presse.com
(I’m not using any DataSet / Database to read data from, the user may type these web addresses in the DataGridView!!)
Any help would be highly appreciated.
Try this approach: