arrow_upward

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to block specific content from running with VB.NET
#1
Hi guys . sorry for long time no vb.net tutorial but now im back with one

so today i will show you how to make a content blocker with vb.net . basically it is will scan all the title of specific word . if it find a window with that title it will kill the process . so this software is great for blocking software from running or blocking unsafe content like pornography for example

so first start with creating a project .
Spoiler Expand
[Image: FvFFXw8.png]

now what you need is one button , one listbox and a timer . a label is optional if you want tell something in your app
Spoiler Expand
[Image: awiAHWJ.png]

now edit the listbox item to add the keyword that you want to block . for example : drug , gambling , porn , etc
Spoiler Expand
[Image: lwP7Gwy.png]

now double click the button and add this code to initiate the timer
Spoiler Expand
[Image: bOFaELc.png]
Spoiler Expand
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       If Button1.Text = "Start Blocking" Then
           Button1.Text = "Stop Blocking"
           Timer1.Start()
       Else
           Button1.Text = "Start Blocking"
           Timer1.Stop()
       End If
   End Sub


after that double click the timer to add the code
Spoiler Expand
[Image: WUFkZw2.png]
Spoiler Expand
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
       For Each keyword As String In ListBox1.Items

           For Each p In Process.GetProcesses
               If p.MainWindowTitle.IndexOf(keyword, 0, StringComparison.CurrentCultureIgnoreCase) > -1 Then
                   Try
                       p.Kill()
                   Catch ex As Exception
                       Try
                           p.CloseMainWindow()
                       Catch exs As Exception

                       End Try

                   End Try
                   MsgBox("Succesfully Blocked!")
               End If

           Next
       Next
   End Sub


now the coding part is finished you can test the app by pressing f5 or start debugging  . and here is the result
Spoiler Expand
[Image: cblock.gif]

if you want the project file you can download it in the attachment


Attached Files
.zip   contentblocker.zip (Size: 70.31 KB / Downloads: 0)
Terminal
humanpuff69@FPAX:~$ Thanks To Shadow Hosting And Post4VPS for VPS 5


person_pin_circle Users browsing this thread: 1 Guest(s)
Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - Hyper Expert - Shadow Hosting - Bladenode - Hostlease - RackNerd - ReadyDedis - Limitless Hosting