hello every body
please can you help me
how to use api functions in c#
such as :
- eject cd drive
- restart the os
- shutdown the monitor
c# and api functions
Started by Computer Engineer, May 26 2010 09:39 PM
6 replies to this topic
#1
Posted 26 May 2010 - 09:39 PM
|
|
|
#2
Posted 27 May 2010 - 02:44 AM
I doubt that you can shut down the monitor in C#. That's hardware-based.
To restart:
using Microsoft.Win32;
and then
System.Diagnostics.Process.Start("ShutDown","/r");
as for the CD, try this: How to Eject CD tray using Win32 API Samples and examples - C#, VB.NET, ASP.NET
If you ask me, I'd rather write a .bat file and then run it from my C# application. (Or prompt the user to do that himself :P )
To restart:
using Microsoft.Win32;
and then
System.Diagnostics.Process.Start("ShutDown","/r");
as for the CD, try this: How to Eject CD tray using Win32 API Samples and examples - C#, VB.NET, ASP.NET
If you ask me, I'd rather write a .bat file and then run it from my C# application. (Or prompt the user to do that himself :P )
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#3
Posted 27 May 2010 - 03:08 AM
#4
Posted 27 May 2010 - 03:12 AM
A simple Google search for "using API's c#" or "C# win32 api" would get you good results.
Start with this:
C# And API's|C# Help – C# Tutorials Resources
And if you ask me, C++ would be better if you want to use Win32 API's, even if it takes longer, you can do much more powerful programs.
Start with this:
C# And API's|C# Help – C# Tutorials Resources
And if you ask me, C++ would be better if you want to use Win32 API's, even if it takes longer, you can do much more powerful programs.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#5
Posted 27 May 2010 - 06:28 AM
thank you Davide can we be friends :)
#6
Posted 27 May 2010 - 06:34 AM
Sure, add me to your MSN: davide.vitelaru@live.com
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#7
Posted 28 May 2010 - 05:56 AM
De-facto standard site for using the win32 API from .NET is pinvoke.net: the interop wiki!.


Sign In
Create Account


Back to top









