Click here to Skip to main content
15,867,756 members
Please Sign up or sign in to vote.
1.31/5 (3 votes)
See more:
hello !
i am working on a small application ,through which i can block any website on my computer , means if i want to block youtube or yahoo at my computer then no one can able to visit them using any webbrowser , is this possible in vb.net or in c#

Regards
Posted
Updated 18-Aug-18 14:54pm

I would say: don't do evil. And please don't tell me that you have this feature as a requirement; I don't care.

You can do it only if you assume that the person installing this "tool" has more advanced privileges than a user. In what settings it could be the case? In all companies I ever knew all employees always get administrative privileges for their local systems on first request. If this is not the case — everything you can block on my computer I can unblock.

—SA
 
Share this answer
 
v2
Comments
badbaoy 31-Jul-12 10:57am    
well Sergey Alexandrovich .i dont need any type of suggestion from you . i asked a simple question if you have proper answer then give it if you dont have any solution for this prob then please do not tell me what to do .
and by the way who you are to unblock everything on my computer :P , well i dont want to use any harsh word for you :P because i think there is nothing to say for fools :P.
I am working on a simple computer lab management application , this application has LAN chat , Usb Blocking , and Site restrictions.

Regards
Sergey Alexandrovich Kryukov 31-Jul-12 11:46am    
I would I care if you need it or not? This is pretty rude of you. You asked for an advice; and this is enough for me. And by the way, 1) this is a really good advice, a practical one, but it takes some understanding; 2) I actually answered you "simple" question in second paragraph, and this is the only valid thing about it.

You should have some logic to understand that a negative solution is still a solution. You aren't a kid who would cry about a toy he cannot get, aren't you?

I know that this is useless, but calling me a fool and maintaining that you don't want harsh words is just funny. It is very usual that such rudeness is only possible in extremely incompetent and illiterate people. Welcome to the club!

--SA
AmitGajjar 12-Jun-13 8:32am    
Hi SA,
Although this is very old post but actually i have similar functionality to achieve. In my case, i have shared internet from my server to other computers. I want to restrict all other computers to access on community site. Can i filter all incoming request from client computers from server using c# ?

Thanks
-Amit
Sergey Alexandrovich Kryukov 12-Jun-13 13:08pm    
I don't see how it is similar, only remotely. Basically, your requirements may have sense, but one by OP — hardly. I think you can only filter out access by IP, as your server receive client IP, or, of course, by authorization. IP is absolutely reliable, but this is a shaky matter: most users won't have static IPs. Very often, IP will be assigned dynamically:

http://en.wikipedia.org/wiki/Dynamic_IP#Dynamic_IP

It means, the same user may have different IPs: due to dynamic assignment, or due to the fact the same person can access the site from different computers or move a computer from one network to another. With WiFi, for example, it may happen all the time. And, due to dynamic assignment, different user can get the same IP.

Now, if all your users are from the same organization with more or less well-defined administration, you can set it up with network administrators, to filter IPs by some allowed subset of addresses. I don't know, it will depend on your organization's setting. Consult those people, they can set up you a solution based on this idea: they will guarantee that your organization users will get some certain IP subset, and you will put it in your configuration. Does it make sense to you?

—SA
AmitGajjar 13-Jun-13 0:13am    
Thanks for your detailed explanation. Certainly you are correct. For big organization they can afford IT Administrator who could setup server and maintain on daily basis. In my case we have so many small firms who could not hire them. So i suggest them to develop a software that can be integrated in their existing software and it can do filtration of some porn sites. Please suggest some solution so i can integrate in the existing C# application. I can add one menu in the application where company head can add restricted sites very easily from the proxy computer. Hope you got some idea about my problem.

Thanks again for your effort.
-Amit
here is full code


Public Function IPAdress(ByVal CompName As String) As String
myIPs = System.Net.Dns.GetHostByName(CompName)
For Each myIP As System.Net.IPAddress In myIPs.AddressList
add = myIP.ToString
Next
Return add.ToString
End Function
VB
Private Sub Button10_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button10.Click
        Blocked()
    End Sub
    Sub Blocked()
        IO.File.AppendAllText("\\" & HostName.ToString.Trim & "\C$\windows\system32\drivers\etc\hosts", vbNewLine & IPAdress(HostName).ToString & vbTab & TextBox2.Text.Trim)
        Load_BlockedSites()
        MessageBox.Show("Site Blocked")
  End Sub



thanks and Regards
sarva
 
Share this answer
 
Follow the steps here:

vb.net - Block webpages and display error page - Stack Overflow[^]


You're welcome!

- A
 
Share this answer
 
Comments
CHill60 20-Aug-18 8:01am    
Badbaoy hasn't interacted with this site for over 6 years so I doubt they will see this suggestion.

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