Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click path = "C:\Windows\System32\drivers\etc\hosts" sw = New StreamWriter(path, True) Dim sitetoblock As String = "\n 127.0.0.1 xyz.com" sw.Write(sitetoblock) sw.Close() Response.Write("<script>alert('Site Blocked'); </script>") End Sub
<script type="text/javascript" language="javascript"> function BlockUrl() { var path = "C:\Windows\System32\drivers\etc\hosts"; var sw = new StreamWriter(path, True); var sitetoblock = vbLf & " 127.0.0.1 xyz.com"; sw.Write(sitetoblock); sw.Close(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)