473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how can i shutdown the cpu from dotnet framework?

hi everone
i want to put button on windows application to shut down
the pc from dot net framework not to use api's
thanks

Nov 20 '05 #1
5 4551
Cor
Hi,
i want to put button on windows application to shut down
the pc from dot net framework not to use api's


There is an old Yiddish joke which goes like this.

Mosh comes at the rabbi and asks "rabbi can God make everything"

And the Rabbi says: "Of course can God make everything he did make the
world"

Than Mosh ask to the rabbi: "rabbi can God make a stone that he cannot raise
himself?

In that joke is a lot of wisdom for me.

A VB.net program needs the framework.

I think the only thing he can do is give command to an Api.

And die when the computer is shut down.

But I can be wrong.

Cor


Nov 20 '05 #2
"mohamed farouk" <to*****@hotmail.com> schrieb
hi everone
i want to put button on windows application to shut down
the pc from dot net framework not to use api's
thanks


You can not do it without API calls. Also have a look at the thread "Turn
off a PC" from yesterday.
--
Armin

Nov 20 '05 #3
Hello,

"mohamed farouk" <to*****@hotmail.com> schrieb:
i want to put button on windows application to shut down
the pc from dot net framework not to use api's
Why not use Windows-API?!

http://msdn.microsoft.com/library/de...tingsystem.asp

http://msdn.microsoft.com/library/de...tingsystem.asp
If possible can u post C# code for doing the


PInvoke solution:

http://www.mentalis.org/soft/class.qpx?id=7

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4
Hello,

"Cor" <no*@non.com> schrieb:
i want to put button on windows application to shut down
the pc from dot net framework not to use api's

[Joke]

LOL

I always love the questions asking to do something without PInvoke...

;-)

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #5
Cor
I see I did not type some words in this sentence

And die when the computer is shut down.

And the frameworks dies when the computer is shut down.
Sorry,
Cor
Nov 20 '05 #6

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

Similar topics

2
by: Madhava Patro | last post by:
Hi All, I have a requirement where i have to Shutdown Windows 2000 from a C# Application, my application is running as windows service. When I shutdown Windows it should not reboot again, It...
2
by: Jack | last post by:
It seems that if Finalize takes more than 2 seconds during the process shutdown, the process will just terminate anyway. How can I specifically tells GC that this guy's clean up does suppose to...
8
by: Bill Sonia | last post by:
I've written a Windows Service to send e-mails on events like OnStart, OnStop, OnShutDown using System.Web.Mail. It works for everything but OnShutdown. My guess is that for OnShutDown, once my...
4
by: Chris Tanger | last post by:
Context: C# System.Net.Sockets Socket created with constructor prarmeters Internetwork, Stream and TCP everything else is left at the default parameters and options except linger may be changed...
1
by: Glenn Wilson | last post by:
Trying to reboot a machine by useing the WMI systems, and I am having no luck. Ihave tried it with Domain Admin Account, Local Admin Account, and still no luck. I keep getting access denied ...
2
by: Brian Worth | last post by:
I have just upgraded from VB 4.0 to VB .NET 2002. One program under VB 4.0 was able to shut down or restart the (windows XP) machine using a series of API calls. (Getlasterror, GetCurrentProcess,...
1
by: Jerry Camel | last post by:
How do you detect when a system is being logged off or shutdown? In VB 6 there was a QueryUnload event that would work if you had a form, but I'm running in a Sub Main scenario... I can't find...
8
by: Jm | last post by:
Hi All I have an app that when running if a user selects logoff or shutdown from the start menu, it will close itself but not logoff windows or shutdown. From what i have found so far its most...
3
by: Treasure Baloyi | last post by:
I am an intermediate visual basic.Net programmer and want to know how to write the code to shutdown windows, irrespective of the version. Your assistance in this regard will be utmost...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.