473,670 Members | 2,615 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Blocking Windows Port using C#

Does anyone know of a way, using C#, to programmaticall y block a
Windows port?
Futhermore I want to know how can we map processes to the ports opened
on a computer using C# and without using existing softwares...
can anyone suggest some techniques...
Regards...
Very.

Mar 2 '07 #1
5 3084
Hi,

"VeryMaqboo l" <ve*********@gm ail.comwrote in message
news:11******** **************@ h3g2000cwc.goog legroups.com...
Does anyone know of a way, using C#, to programmaticall y block a
Windows port?
No, there is no way of doing that, you need to have a firewall installed and
be able to configure it from your code. Now I would explore the possibility
of using WMI on a XP SP2 machine, maybe you can use it.
But again, if the user has the firewall disable you can do nothing.
Futhermore I want to know how can we map processes to the ports opened
on a computer using C# and without using existing softwares...
can anyone suggest some techniques...
Not clear what you want, could you be more explicit?
Mar 2 '07 #2
On Mar 2, 3:09 pm, "VeryMaqboo l" <verymaqb...@gm ail.comwrote:
Does anyone know of a way, using C#, to programmaticall y block a
Windows port?
Futhermore I want to know how can we map processes to the ports opened
on a computer using C# and without using existing softwares...
can anyone suggest some techniques...
Regards...
Very.
I was trying to do something similar to this a year or so ago and was
very disappointed. There is no documented way to do this on a high
level in Windows. The only possible solution I found was to write your
own device driver that can sit on the network adapter and filter
traffic. This solution was more work than it was worth for me so I
never followed through on it. If you find more information please post
back here on it. Good luck.

Mar 3 '07 #3

Futhermore I want to know how can we map processes to the ports opened
on a computer using C# and without using existing softwares...
can anyone suggest some techniques...
By this I mean... I want to find out which process or which .exe file
is sending/recieving data on which port...
Thanks for your concern....
Hope to see more suggestions...

Regards..
Very.

Mar 3 '07 #4
"VeryMaqboo l" <ve*********@gm ail.comwrote in message
news:11******** ************@64 g2000cwx.google groups.com...
>
>Futhermore I want to know how can we map processes to the ports opened
on a computer using C# and without using existing softwares...
can anyone suggest some techniques...

By this I mean... I want to find out which process or which .exe file
is sending/recieving data on which port...
Thanks for your concern....
Hope to see more suggestions...

Regards..
Very.

netstat.exe -a -b

Willy.

Mar 3 '07 #5
I found a command line utility (fPort) for finding open ports on a
computer and thier associated processes..
and the one for blocking and unblocking the ports....

My point is.. Can these utilities be invoked in a C# program....???I f
not then is their some other way of doing these in C#...???

Regards,
Very..
Mar 4 '07 #6

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

Similar topics

4
5914
by: Jonathan Fine | last post by:
Hello I have written a program that interacts with a command line program. Roughly speaking, it mimics human interaction. (With more speed and accuracy, less intelligence.) It works fine under Linux, using select().
4
4020
by: Anthony Boudouvas | last post by:
Hi to all, i have a form with 2 System.Windows.Forms.Timer objects. One fire every 5 seconds and the other every 10 seconds, the both take actions in two hashtables declared in same form. When timers fire, main form is somewhat blocking until timers finish their job, (socket operations). (Imagine to move the form by it's caption bar and it somewhat freeze when timers fire...)
7
17401
by: Michi Henning | last post by:
Hi, I'm using a non-blocking connect to connect to a server. Works fine -- the server gets and accepts the connection. However, once the connection is established, I cannot retrieve either the local or the remote endpoint from the client-side socket. The *really* strange thing is that Socket.LocalEndPoint is null. According to the doc, that's impossible: reading the LocalEndPoint
20
2011
by: Charles Law | last post by:
Consider the following scenario: A data packet is sent out of a serial port and a return packet is expected a short time later. The application sending the packet needs to send another packet as soon as the return packet has been received. It needs to wait for the return packet, but time out if one is not received. Whilst packets are being exchanged the application needs to be responsive.
6
9244
by: JustinC | last post by:
Does anyone know of a way, using C#, to programmatically block a Windows port? I've looked into some low level solutions like NDIS, but am hoping to find something that uses C#. Any help would be greatly appreciated.
8
9150
by: Alejandro | last post by:
Hi: I'm using pySerial to talk to a RS232 to RS485 converter. In order to control the converter, I need to control the DTR line to enable/disable de RS485 driver. In particular, I need to : write a character to the serial port set the DTR line to level 1 _after_ the last bit of the character is send
0
1300
by: alnsaisrinivas | last post by:
Hi I've a problem with I/O blocking on my serial port at this particular scenario... 1.I've developed a driver to communicate with some device using Serial Comm (overlapped I/O). 2.I'm able to send and receive messages perfectly. 3.As part of integration few more drivers also exist inorder to communicate with different devices. 4.I'm getting I/O blocking and application hangs up for my driver, when a particular driver is invoked before...
1
2053
by: maano | last post by:
Does anyone know of a way to programmatically block a Windows port using C#..?
3
8353
by: mp | last post by:
Code is at bottom. Basically, if I turn off socket blocking prior to connecting, I get a "Socket is not connected" error when I try to send data. However, if I do not turn off blocking, OR if I place a print statement anywhere before the send call, it works! WTF? I'd like to understand what's going on in the background here, if you know don't skimp on the details. Thanks
0
8471
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
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
8903
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
8815
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
8592
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
7421
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6216
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4213
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2044
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.