TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mihaly Varga
NA
13
8.5k
Shutdown program in c#
Jan 8 2013 12:16 PM
I want to write a program, which is shut down, or restart the pc.
In the form, i have a datetimepicker tool, and 2 button. So, my question is, which code can i shut down the pc, and how can i read the selected time from the datetimepicker ( which is set to time ( h/m ) ) ?
The code is currently:
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void dateTimePicker1_ValueChanged(object sender, EventArgs e)
{
dateTimePicker1.Format = DateTimePickerFormat.Short;
dateTimePicker1.Value = DateTime.Today;
}
private void button1_Click(object sender, EventArgs e)
{
DateTime iDate;
iDate = dateTimePicker1.Value;
MessageBox.Show("A kiválasztott dátum: " + iDate);
}
private void button2_Click(object sender, EventArgs e)
{
DateTime iDate;
iDate = dateTimePicker1.Value;
MessageBox.Show("A kiválasztott dátum: " + iDate);
}
}
}
Reply
Answers (
1
)
Process error
C# move file