Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.IO;
- namespace conHOSTSEditor
- {
- class Program
- {
- static void Main(string[] args)
- {
- string defaultPath = @"C:\WINDOWS\System32\drivers\etc\Hosts";
- string Content;
- string[] LineContent;
- StreamReader reader = new StreamReader(defaultPath);
- Content = reader.ReadToEnd();
- LineContent = Content.Split('\n');
- foreach (string Line in LineContent)
- {
- if(Line.Contains("127.0.0.1"))
- {
- Line.Replace('\t', ' ');
- Console.WriteLine(Line);
- }
- }
- Console.ReadLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement