Fetstil Fetstil Kursiv Understrykning linje färgläggning tabellverk Punktlista Nummerlista Vänster Centrerat högerställt Utfyllt Länk Bild htmlmode
  • Forum & Blog
    • Forum - översikt
      • .Net
        • asp.net generellt
        • c#
        • vb.net
        • f#
        • silverlight
        • microsoft surface
        • visual studio .net
      • databaser
        • sql-server
        • databaser
        • access
        • mysql
      • mjukvara klient
        • datorer och komponenter
        • nätverk, lan/wan
        • operativsystem
        • programvaror
        • säkerhet, inställningar
        • windows server
        • allmänt
        • crystal reports
        • exchange/outlook
        • microsoft office
      • mjukvara server
        • active directory
        • biztalk
        • exchange
        • linux
        • sharepoint
        • webbservers
        • sql server
      • appar (win/mobil)
      • programspråk
        • c++
        • delphi
        • java
        • quick basic
        • visual basic
      • scripting
        • asp 3.0
        • flash actionscript
        • html css
        • javascript
        • php
        • regular expresssion
        • xml
      • spel och grafik
        • DirectX
        • Spel och grafik
      • ledning
        • Arkitektur
        • Systemutveckling
        • krav och test
        • projektledning
        • ledningsfrågor
      • vb-sektioner
        • activeX
        • windows api
        • elektronik
        • internet
        • komponenter
        • nätverk
        • operativsystem
      • övriga forum
        • arbete karriär
        • erbjuda uppdrag och tjänster
        • juridiska frågor
        • köp och sälj
        • matematik och fysik
        • intern information
        • skrivklåda
        • webb-operatörer
    • Posta inlägg i forumet
    • Chatta med andra
  • Konto
    • Medlemssida
    • Byta lösenord
    • Bli bonsumedlem
    • iMail
  • Material
    • Tips & tricks
    • Artiklar
    • Programarkiv
  • JOBB
  • Student
    • Studentlicenser
  • KONTAKT
    • Om pellesoft
    • Grundare
    • Kontakta oss
    • Annonsering
    • Partners
    • Felanmälan
  • Logga in

Hem / Forum översikt / inlägg

Posta nytt inlägg


Shut down timer

Postades av 2011-05-09 04:00:25 - johan johansson, i forum visual basic - allmänt, Tråden har 3 Kommentarer och lästs av 2099 personer

Tjo kollade igenom min dator och råkade hitta ett par gamla projekt!
1,a en timer som agerar efter sec! = va bland det första jag gjorde!
2,a en timer som agerar efter min! = Uppföljaren, dock onödigt mkt kod!
3,e 90% klar, dock avstannat projekt, men kmr sen när jag få för mig att göra klar den :)

1,a -----------------------------------------

3, buttons
2, comboboxes
1, textbox
10, timers

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
TextBox1.Text = 0
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TextBox1.Text += 1
If TextBox1.Text = ComboBox1.Text Then
Shell("shutdown -s")
Timer1.Stop()
End If
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
MsgBox("10/s!" & vbCrLf & "100/s!" & vbCrLf & "1800/s = 1/2H!" & vbCrLf & "3600/s = 1H!" & vbCrLf & "5400/s = 1.1/2H!" & vbCrLf & "7200/s = 2H!", MsgBoxStyle.Information, "Made by miz™")
End Sub
End Class



---------------------------------------------

2,a-----------------------------------------

'3: buttons = Glassbuttons fräsh efekt :) se här = http://pellesoft.se/communicate/forum/view.aspx?msgid=288908&forumid=2&sum=1
'1: timer
'1: combobox
'1: textbox



Public Class Form1


Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TextBox1.Text += 1
If TextBox1.Text = 30 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer1.Stop()
End If

End Sub

Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
TextBox1.Text += 1
If TextBox1.Text = 60 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer2.Stop()
End If

End Sub

Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
TextBox1.Text += 1
If TextBox1.Text = 90 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer3.Stop()
End If

End Sub

Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
TextBox1.Text += 1
If TextBox1.Text = 120 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer4.Stop()
End If

End Sub

Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
TextBox1.Text += 1
If TextBox1.Text = 150 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer5.Stop()
End If

End Sub

Private Sub Timer6_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer6.Tick
TextBox1.Text += 1
If TextBox1.Text = 180 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer6.Stop()
End If

End Sub

Private Sub Timer7_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer7.Tick
TextBox1.Text += 1
If TextBox1.Text = 210 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer7.Stop()
End If

End Sub

Private Sub Timer8_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer8.Tick
TextBox1.Text += 1
If TextBox1.Text = 240 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer8.Stop()
End If

End Sub

Private Sub Timer9_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer9.Tick
TextBox1.Text += 1
If TextBox1.Text = 270 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer9.Stop()
End If

End Sub

Private Sub Timer10_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer10.Tick
TextBox1.Text += 1
If TextBox1.Text = 300 Then
ComboBox1.Text = "Shutdown"
Shell("shutdown -s")
ElseIf ComboBox1.Text = "Loggoff" Then
Shell("shutdown -l")
ElseIf ComboBox1.Text = "Restart" Then
Shell("shutdown -r")
Timer10.Stop()
End If

End Sub

Private Sub GlassButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GlassButton1.Click
If ComboBox2.Text = "30min" Then
Timer1.Start()
ElseIf ComboBox2.Text = "1.hour" Then
Timer2.Start()
ElseIf ComboBox2.Text = "1.1/5hour" Then
Timer3.Start()
ElseIf ComboBox2.Text = "2.hour" Then
Timer4.Start()
ElseIf ComboBox2.Text = "2.1/5hour" Then
Timer5.Start()
ElseIf ComboBox2.Text = "3.hour" Then
Timer6.Start()
ElseIf ComboBox2.Text = "3.1/5hour" Then
Timer7.Start()
ElseIf ComboBox2.Text = "4.hour" Then
Timer8.Start()
ElseIf ComboBox2.Text = "4.1/5hour" Then
Timer9.Start()
ElseIf ComboBox2.Text = "5.hour" Then
Timer10.Start()
End If

End Sub

Private Sub GlassButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GlassButton3.Click
MsgBox("1:Chose option" & vbCrLf & "Shutdown / Restart / Loggoff" & vbCrLf & "2:Select time" & vbCrLf & "Then press start" & vbCrLf & "Stop/Reset stop al timers!", MsgBoxStyle.Information, "Made by miz™")
End Sub

Private Sub GlassButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GlassButton2.Click
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
Timer5.Stop()
Timer6.Stop()
Timer7.Stop()
Timer8.Stop()
Timer9.Stop()
Timer10.Stop()
TextBox1.Text = 0
Shell("shutdown -a")
End Sub

End Class

---------------------------------------------

Anledning till detta projekt = somna till film är bland det bästa :)


Svara

Sv: Shut down timer

Postades av 2011-05-09 20:52:56 - Robert Israelsson

Hade det inte varit enklare att använda den inbyggda shutdown kommandot, typ shutdown -s -t [tid i sekunder till avstängning]

Eller varför inte det eminenta psshutdown från gamla goa sysinternals där man, hör och häpna, kan ange klockslag när avlust/omstart ska ske: http://technet.microsoft.com/en-us/sysinternals/bb897541


Svara

Sv:Shut down timer

Postades av 2011-05-10 19:04:27 - johan johansson

Kanske är enklare. men roligare att göra egna prog :)

klockslag när avlust/omstart är också en möjlighet,
har den funktionen i den senaste timern jag programerat, dock är den inte klar
då jag tröttnade på det, men kmr väl nån dag de med :)

Kände bara för att lägga till nått i forumet!


Svara

Sv: Shut down timer

Postades av 2011-05-11 17:39:23 - Sven Åke Persson

Jag skrattar när jag läser allt detta Bullshit.

Allt du skrivet kan man göra med en Timer.

Sen kör man Select Case på alla varinter.

Uhhhhhhhhh för trånghuvud.


Svara

Nyligen

  • 19:38 Rekommendera något intressant
  • 19:13 Международная перевозка грузов
  • 00:01 DL Van Tuning | Exclusive Body Kit
  • 12:08 Indian casino
  • 04:14 Vad finns det för kratomalternativ
  • 14:16 Indian online casino
  • 14:15 Indian online casino
  • 08:28 Butiksskyltar: Hur upplever utbude

Sidor

  • Hem
  • Bli bonusmedlem
  • Läs artiklar
  • Chatta med andra
  • Sök och erbjud jobb
  • Kontakta oss
  • Studentlicenser
  • Skriv en artikel

Statistik

Antal besökare:
Antal medlemmar:
Antal inlägg:
Online:
På chatten:
4 570 872
27 965
271 770
736
0

Kontakta oss

Frågor runt konsultation, rådgivning, uppdrag, rekrytering, annonsering och övriga ärenden. Ring: 0730-88 22 24 | pelle@pellesoft.se

© 1986-2013 PelleSoft AB. Last Build 4.1.7169.18070 (2019-08-18 10:02:21) 4.0.30319.42000
  • Om
  • Kontakta
  • Regler
  • Cookies