السلام عليكم ورحمه الله وبركاته
هلا اخي يوسف قمت بعمل مثال بسيط مثل ما تريد بالضبط
هذه صور للبرنامج
حالة ايقاف تشغيل الكمبيوتر
![[صورة مرفقة: y8K88.png]](http://im41.gulfup.com/y8K88.png)
حالة اعادة تشغيل الكمبيوتر
![[صورة مرفقة: Lc89Z.png]](http://im41.gulfup.com/Lc89Z.png)
ويمكنك تحميل البرنامج طبعا اذا كنت تستخدم visual studio 2012
http://www.psmaax.com/upload/do.php?id=699
وكلمة المرور هي : eng.khalidvb
وها هو الكود تفضل :
والسلام عليكم ورحمه الله وبركاته
هلا اخي يوسف قمت بعمل مثال بسيط مثل ما تريد بالضبط
هذه صور للبرنامج
حالة ايقاف تشغيل الكمبيوتر
![[صورة مرفقة: y8K88.png]](http://im41.gulfup.com/y8K88.png)
حالة اعادة تشغيل الكمبيوتر
![[صورة مرفقة: Lc89Z.png]](http://im41.gulfup.com/Lc89Z.png)
ويمكنك تحميل البرنامج طبعا اذا كنت تستخدم visual studio 2012
http://www.psmaax.com/upload/do.php?id=699
وكلمة المرور هي : eng.khalidvb
وها هو الكود تفضل :

PHP كود :
Public Class Form1
Dim hh As Integer
Dim mm As Integer
Dim ss As Integer
Public countDown As New TimeSpan(hh, mm, ss)
Dim stpw As New Stopwatch
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub btn_shutdown_Click(sender As Object, e As EventArgs) Handles btn_shutdown.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
MsgBox("الرجاء ملئ الحقول الفارغة")
Exit Sub
End If
Label2.Visible = True
hh = CInt(Int(TextBox1.Text))
mm = CInt(Int(TextBox2.Text))
ss = CInt(Int(TextBox3.Text))
Timer1.Interval = 250
Timer1.Start()
stpw.Start()
Label4.Visible = True
Label5.Visible = False
Label8.Visible = True
Label8.Text = "ايقاف تشغيل الكمبيوتر"
Label8.ForeColor = Color.Red
End Sub
Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim countDown As New TimeSpan(hh, mm, ss) 'ten seconds
If stpw.Elapsed <= countDown Then
Dim toGo As TimeSpan = countDown - stpw.Elapsed
Label2.Text = String.Format("{0:00}:{1:00}:{2:00}", toGo.Hours, toGo.Minutes, toGo.Seconds)
Else
Timer1.Stop()
stpw.Stop()
Label4.Text = Label2.Text
Label5.Text = Label2.Text
End If
'This will make the computer Shutdown
If Label4.Text = Label2.Text Then
System.Diagnostics.Process.Start("shutdown", "-s -t 00")
'This will make the computer Restart
ElseIf Label5.Text = Label2.Text Then
System.Diagnostics.Process.Start("shutdown", "-r -t 00")
End If
End Sub
Private Sub btn_restart_Click(sender As Object, e As EventArgs) Handles btn_restart.Click
If TextBox1.Text = "" Or TextBox2.Text = "" Or TextBox3.Text = "" Then
MsgBox("الرجاء ملئ الحقول الفارغة")
Exit Sub
End If
Label2.Visible = True
hh = CInt(Int(TextBox1.Text))
mm = CInt(Int(TextBox2.Text))
ss = CInt(Int(TextBox3.Text))
Timer1.Interval = 250
Timer1.Start()
stpw.Start()
Label4.Visible = False
Label5.Visible = True
Label8.Visible = True
Label8.Text = "أعادة تشغيل الكمبيوتر"
Label8.ForeColor = Color.Green
End Sub
End Class
والسلام عليكم ورحمه الله وبركاته



![[صورة مرفقة: eVR2f.png]](http://im32.gulfup.com/eVR2f.png)

![[صورة مرفقة: 13797832361.png]](http://www.mlfnt.com/lives6/13797832361.png)
