473,800 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to block network traffic ?

Hi

In serveral firewall softwares you can block network traffic quickly with
one click, can I do the same in c# ?

Thanks
Nov 17 '05 #1
3 6925
Omega wrote:
Hi

In serveral firewall softwares you can block network traffic quickly with
one click, can I do the same in c# ?

Thanks


If you build a firewall in C#, yes.

Although I think it is possible, building the necessary driver-level
software in C or C++ would probably be a lot easier.

In any case, building a working firewall application is not an easy task
in any language. You need specific knowledge about how to hook into the
network subsystem and how to handle the flow of traffic properly at that
level.

If, on the other hand, you're asking if you can "press that button" in
the firewall software from C#, you might be able to but I doubt it.
Usually the interaction with the firewall software is only possible
through the GUI for the application so that malicious programs can't
interfere with its operation. In any case, that's probably a question
you need to ask the makers of the firewall program you want to control.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vk arlsen.no
PGP KeyID: 0x2A42A1C2
Nov 17 '05 #2
"Lasse Vågsæther Karlsen" <la***@vkarlsen .no> wrote in message
news:On******** ******@TK2MSFTN GP12.phx.gbl...
If, on the other hand, you're asking if you can "press that button" in
the firewall software from C#, you might be able to but I doubt it.
Usually the interaction with the firewall software is only possible
through the GUI for the application so that malicious programs can't
interfere with its operation.


You'd think that was true. But I'm convinced that my Bit Torrent client (or
is it eMule) can programmtically open a port on the Windows firewall. I
didn't think much to it at the time, I just clicked yes so I could get my
Battlestar Galactica fix. But now you come to mention it....:)

Windows may have prompted me to allow or refuse the change, I can't
remember.

--
Regards,

Tim Haughton

Agitek
http://agitek.co.uk
http://blogitek.com/timhaughton
Nov 17 '05 #3

"Lasse Vågsæther Karlsen" <la***@vkarlsen .no> wrote in message
news:On******** ******@TK2MSFTN GP12.phx.gbl...
Omega wrote:
Hi

In serveral firewall softwares you can block network traffic quickly with
one click, can I do the same in c# ?

Thanks


If you build a firewall in C#, yes.

Although I think it is possible, building the necessary driver-level
software in C or C++ would probably be a lot easier.

In any case, building a working firewall application is not an easy task
in any language. You need specific knowledge about how to hook into the
network subsystem and how to handle the flow of traffic properly at that
level.

If, on the other hand, you're asking if you can "press that button" in the
firewall software from C#, you might be able to but I doubt it. Usually
the interaction with the firewall software is only possible through the
GUI for the application so that malicious programs can't interfere with
its operation. In any case, that's probably a question you need to ask the
makers of the firewall program you want to control.

--
Lasse Vågsæther Karlsen
http://www.vkarlsen.no/
mailto:la***@vk arlsen.no
PGP KeyID: 0x2A42A1C2


Note that you can't build drivers using C#.

Willy.
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3443
by: jayderk | last post by:
Hello all, I am having a problem with one of my desktop applications and was wondering if any of you know of a good tool I can use to monitor traffic in and out of my network card? this is a urgent problem. regards,
2
3742
by: Ulf | last post by:
Hi, is there any way to programmatically limit the network traffic received on a network adapter in C# ? I need to simulate different speeds over an ADSL connection and run tests covering speed limits from 1Mbps to 8Mbps on a single machine. So far I found a shareware (NetLimiter) that pretty much covers my needs, but I'd rather find a programming solution I could include in my testscripts.
1
1859
by: Omega | last post by:
Hi In serveral firewall software you can block all network traffic with one click, can I do the same in c# ? Thanks
10
2719
by: Lespaul36 | last post by:
I need to write a program to block certain URLs when web browsing, but I have not been able to really find anything to help. I was hoping to have a service running in the back that can check browser windows and compare the URLs then post a message and shut down the web page if it matches....Any one have a good starting point for me. TIA Dave
0
979
by: news.microsoft.com | last post by:
Any idea how to block traffic on a computer going to specific ip subnets using a vb.net application? Thanks, Shawn
3
2897
by: LucaBrasi | last post by:
I am curious about how Access 2000 handles network requests for data. I have the data on a back-end server, and the front-end is installed on the local machine. Now, lets say I have a select query ( call it qry1) which has no filters and just displays all the records in the table, and another query (qry2) which has a filter. Both are queries on the same table of 5000 rows. If the qry2 filter matches only 1000 of the rows, is network...
0
989
by: akhtar | last post by:
How to secure your network Check this article to know how a network analyzer continuously monitors traffic on network and provides detailed information about critical problems, virus attacks and even generates traffic to stress test your network http://www.network-analyzer.blogspot.com
7
7692
by: Marc Bartsch | last post by:
Hi, I have a background worker in my C# app that makes a synchronous HttpWebRequest.GetResponse() call. The idea is to POST a file to a server on the internet. When I call HttpWebRequest.Abort() on the request object on another thread, GetResponse() returns with an exception as expected. However, when I monitor the network traffic, it does not seem to stop, but to continue to be active and to upload the file. The network is active even...
1
2624
by: maverickman4 | last post by:
background/setup info: so we have a network set up of about 23 computers including our server which is running windows 2003 standard. we have an incredible amount of traffic going to that server due to every workstation viewing and writing data every few seconds. this is an orthodontic office that is completely paperless. charts and personal info are all on one SQL database on one server. i have pictures to manage and everything. but between...
0
9551
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10504
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10274
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10251
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10033
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4149
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3764
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2945
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.