Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Wondering is it possible to write a program which talks to motherboard directly in c#. Consider an example, suppose I want to tell motherboard to disable all the USB ports available something like I want motherboard to stop power supply to all the available USB ports. In the same way if I want to tell MB to disable audio port by disconnecting the power supply. Can I achieve this in C#? If no suggest me what do I need to learn.

Thank You.

What I have tried:

Google on this but dint got relevant info
Posted
Updated 17-Aug-16 4:43am

No, you can't.
There is no standard OS function to disable the USB ports, or the audio output.

You could probably do it - with a lot of work - for specific devices, but there isn't a generic feature to do it all for you.

What on Earth would you want to do that for anyway? Particularly given that many mouse and keyboard combos are connected via the USB port.
 
Share this answer
 
Comments
partha143 17-Aug-16 9:22am    
Sorry for asking this silly question. More over I just got this idea to play around with my friends if at all I could implement it in c# :). Thanks for your reply. So what do you suggest me apart from c# where I can achieve this :).
OriginalGriff 17-Aug-16 9:32am    
Don't even try it.
That kind of program is malicious - and may even be illegal in many countries - if it "escaped into the wild" you could find your self liable for a lot of damages and / or prison time.
Besides, this is not a site for such "pranks" - this is for professional developers, and as such we work hard to prevent such rubbish being produced!

If you want to know how to create such things, you need to visit a hacking site: but be sure to disable all firewalls and antivirus products first or they won't trust you enough to tell you.
partha143 17-Aug-16 10:30am    
Thank you for all the comments sir :)
I'm doubt that you can tell a motherboard to cut power supply to a specific (connected or on-board device) at all...
In any case you can't talk directly to the hardware as at least the BIOS (but in most cases the OS) stands in your way...
In OS, like Windows you can't even access BIOS directly (since DOS BIOS not even used much if at all)...
So - for C# it is a definite no...
 
Share this answer
 
Comments
partha143 17-Aug-16 9:23am    
Apart from c#, can this be achieved by firmware programming? if not any other option?
Kornfeld Eliyahu Peter 17-Aug-16 9:31am    
First of all you should check with the manufacturer if it is possible to cut the power from code (or only physical disconnect) - I think the answer is no...
partha143 17-Aug-16 10:28am    
How about with firmware/embedded programming??
Quote:
suppose I want to tell motherboard to disable all the USB ports available something like I want motherboard to stop power supply to all the available USB ports.

No, the OS is here to prevent you from doing this. Any way, since keyboard and mouse are USB, it is a bad idea.
Quote:
More over I just got this idea to play around with my friends
This is called MalWare.

Technically the thing is possible but imply to replace part of the OS, which is something reserved to highly skilled and specialized programmers with probably years of practice on this domain.
The language is probably C++.
This kind of "driver" enter in the "ring 0" category, which the closest to hardware, like the driver to handle a new graphic card.
Quote:
how does the hibernate mode work on windows?
You are lucky, it is another don't touch.
Hibernate basically turn off the computer.
What is the exact reason why you want to do all this ?
This kind of things is in same category as "cutting breaks of a car", you don't do this unless you want to harm someone.
Quote:
In that case why does OS is not preventing it from doing it?
Hibernate is done by the OS.
Hibernate is what the OS do when you let your laptop turned on while you go to lunch.
 
Share this answer
 
v3
Comments
partha143 17-Aug-16 10:59am    
Thank you ppolymorphe. Based on the above comments which others have said it is not possible, how does the hibernate mode work on windows? It totally shut downs your keyboard mouse hard disk and almost most of the component unless the power button is hit again. I don't know what exactly does hibernate mode does, I mean does it really shut downs the power to those component from motherboard or it might tell those component to go sleep. In that case why does OS is not preventing it from doing it?

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