Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello everyone.

I am developing a remote control application where I can block Student Internet Access (which is wireless.)

Could you please give me a way to do this?
And also, it will also need to have a function to RE-ENABLE internet access.

I've tried:
*LAN disconnection
*RAS
*ipconfig /release

Please help as soon as possible!

Thanks very much.
Posted
Comments
Richard C Bishop 14-Feb-13 10:07am    
If you are developing such an application, post the code you have so far so that we can better understand what it is you are trying to accomplish.
[no name] 16-Feb-13 5:52am    
ok, here's the code.
[code]
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.Text
Public Class Form1
Private Const port As Integer = 54545
Private Const broadcastAddress As String = "255.255.255.255"
Private sendingClient As UdpClient
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeSender()
End Sub
Private Sub InitializeSender()
sendingClient = New UdpClient(broadcastAddress, port)
sendingClient.EnableBroadcast = True
End Sub
public toSend As String
Dim data() As Byte
Public Shared Sub go()
Form1.data = Encoding.ASCII.GetBytes(Form1.toSend)
Form1.sendingClient.Send(Form1.data, Form1.data.Length)
End Sub
Private Sub ConnectInternet_Click() Handles ConnectInternet.Click
tosend="CONNECTINTERNET"
go()
End Sub
Private Sub DisconnectInternet_Click() Handles DisconnectInternet.Click
tosend="DISCONNECTINTERNET"
go()
End Sub
end class
[/code]

And, the client side:

[code]
Imports System.Net
Imports System.Net.Sockets
Imports System.Threading
Imports System.Text
public class form1
Delegate Sub AddMessage(ByRef message As String)
Private Const port As Integer = 54545
Private Const broadcastAddress As String = "255.255.255.255"
Private receivingClient As UdpClient
Private receivingThread As Thread
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
InitializeReceiver()
End Sub
Private Sub InitializeReceiver()
receivingClient = New UdpClient(port)
Dim start As ThreadStart = New ThreadStart(AddressOf Receiver)
receivingThread = New Thread(start)
receivingThread.IsBackground = True
receivingThread.Start()
End Sub
Private Sub Receiver()
Dim endPoint As IPEndPoint = New IPEndPoint(IPAddress.Any, port)
Dim messageDelegate As AddMessage = AddressOf MessageReceived
While (True)
Dim data() As Byte
data = receivingClient.Receive(endPoint)
Dim message As String = Encoding.ASCII.GetString(data)
Invoke(messageDelegate, message)
End While
End Sub
Private Sub MessageReceived(ByRef message As String)
if message="DISCONNECTINTERNET" Then
...
elseif message="CONNECTINTERNET" Then
...
end if
End Sub
end class
[/code]

THE PROBLEM:

*i don't know how to block/unblock internet
*once internet is blocked, will the message go through the network to unblock it?
Sergey Alexandrovich Kryukov 12-Mar-13 12:19pm    
Blocking of Internet access is evil. Maybe we should block your access to this site, to let you experience how it feels? :-)
—SA

1 solution

The suggestion below is not to be taken too seriously ;)

How about rigging up a cheap networked computer with a piece of string connected to the cd tray - leave the tray open and connect this string to the end of the ethernet cable that is connected to the modem.

When you want to disconnect the students simply issue a command to close the cd tray and the ethernet cable will be disconnected from the modem thus stopping an internet connection.

I am still working on the reconnecting part...
 
Share this answer
 
Comments
fjdiewornncalwe 14-Feb-13 12:12pm    
"I am still working on the reconnecting part..."... All you need is a poking stick...
[no name] 16-Feb-13 5:40am    
that's quite a funny idea, but the client will just pull the string off! :)
Sergey Alexandrovich Kryukov 12-Mar-13 13:22pm    
:-) !
Sergey Alexandrovich Kryukov 12-Mar-13 12:23pm    
Markus, please see my comment to the "question" and this "answer". How about their own access?..
—SA
Sergey Alexandrovich Kryukov 12-Mar-13 12:22pm    
You, too, apparently have nothing against doing evil against people. Perhaps we should isolate your from this forum. This way, you would have a chance to experience the feeling. We don't need a string, it's done much easier. :-)
—SA

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