Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to block all inbound port to do not share my system screen to anyone on network through net monitor for employee configuration in vb.net

i am able to disable ctrl+alt+del but not able to stop screen shearing.

Please help.

What I have tried:

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Me.Size = SystemInformation.PrimaryMonitorSize
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
Me.Location = New Point(0, 0)
Me.WindowState = FormWindowState.Maximized
'Me.TopMost = True
Me.FormBorderStyle = 0

'Make center all components
'Dim mainScreen As Screen = Screen.FromPoint(Me.Location)
'Dim mywidth = GroupBox1.Width / 2
' Dim myhight = GroupBox1.Height / 2
' Dim X As Integer = (mainScreen.WorkingArea.Width - (mywidth * 2)) / 2 + mainScreen.WorkingArea.Left
' Dim Y As Integer = (mainScreen.WorkingArea.Height - (myhight * 2)) / 2 + mainScreen.WorkingArea.Top
' GroupBox1.Location = New Point(X, Y)
SerialPort1.BaudRate = TextBox1.Text
SerialPort1.Close()
'Disable START Button
Dim process As System.Diagnostics.Process = Nothing
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "taskkill.exe"
psi.Arguments = "/F /IM explorer.exe"
process = System.Diagnostics.Process.Start(psi)

'Disable ALT+CTRL+DEL
Timer1.Start()


WebBrowser1.Navigate(New Uri("http://rediff.com"))


End Sub

Private Sub Button2_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If TextBox1.Text = "1122" Then
Dim process As System.Diagnostics.Process = Nothing
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = "explorer.exe"
'psi.Arguments = "/F /IM explorer.exe"
process = System.Diagnostics.Process.Start(psi)
Me.Hide()
Application.Exit()
Else
Label1.Text = ("Incorrect Password")
End If
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
For Each selProcess As Process In Process.GetProcesses
If selProcess.ProcessName = "taskmgr" Then
selProcess.Kill()
Exit For
End If
Next
End Sub

Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
If (e.CloseReason = CloseReason.UserClosing) Then
e.Cancel = True
MessageBox.Show("Closing of the launcher is not allowed", "Security", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub

End Class
Posted
Updated 30-Dec-17 5:24am

First, none of that code blocks Ctrl-Alt-Del, which you can't even block in the first place, and your machine will not "share" it's screens to just any other machine unless you explicitly allow it at the time of connection.

You cannot block ports from your VB.NET code. You'd have to write a firewall application to do that, including a filter driver, but why would you go through all that work when Windows already a firewall built into it?

You can write code to manipulate the firewall rules, but only if you have admin permissions to the firewall on the machine.
 
Share this answer
 
Comments
[no name] 30-Dec-17 11:38am    
yep +5
pdoxtader 12-Jan-18 10:12am    
Exactly. +5
The issue is, we can not use centralized firewall as well as systems firewall.

and we also need to block all inbound ports. There are so many software to watch your desktop activities and also can operate your desktop in same network.

And we need to stop this activity with in my code.

Please help to resolve the issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900