Letzten Systemstart anzeigen

  • VB.NET

Es gibt 17 Antworten in diesem Thema. Der letzte Beitrag () ist von Ninoxo.

    Letzten Systemstart anzeigen

    Hey ihr :P

    Ich fasse mich kurz:
    Ich möchte die Zeit und das Datum des letzten Systemstarts anzeigen,
    allerdings sehe ich persönlich keine Methode zum umsetzen.

    Auch Gogle bringt nichts passendes.
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!
    Es geht nicht um ein programm, sondern um eine Funktion,
    welche auf Rechnern aller Art verwendet werden kann / soll.

    Also kein Programm ;)
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!

    VB.NET-Quellcode

    1. Public Shared Function xxx ()
    2. 'Code
    3. End Function
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!
    Sorry, ich bin VB6ler... Ich denke mal das der Befehl das Framework veranlasst die Api aufzurufen...
    Wenn meine Meisterschule durch ist, werde ich mich mal mit .NET beschäftigen...
    Gruß
    Peterfido

    Keine Unterstützung per PN!
    Die Lösung von Pascal scheint gut zu fuktionieren,
    trozdem bin ich erstaunt das es dafpr keine Funktion / Erweiterung gibt ?

    Denn im Moment habe ich die Zeit,
    ich hätte aber gerne eine Angabe die Zeit und Datum erfasst,
    etwa '07.05.2011 09:24'...
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!
    Entschuldige, aber was hat das damit zu tun ?
    Ich programmiere eine Lib, die Infos aus dem Computer ausliest, auch
    Installationsdatum und so...

    Und da kann jeder einzelne die Funktionen für seine Zwecke nutzen,
    ich stelle doch nur eine Auswahl zusammen :-o
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!
    Dankeschön, damit kann ich schon etwas anfangen, auch wenn ich nochmal
    überlegen muss, da es mir für eine Funktion (bzw. dll) nicht grade angemessen
    scheint...

    Aber daraus kann ich mir schon das richtige basteln ;)

    Falls noch jemand eine bessere Möglichkeit wissen sollte
    kann er die ja noch posten, mir wurde geholfen :)

    Dankeschön und Erledigt
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!
    Für alle die es brauchen habe ich es nun perfekt
    hinbekommen ;)

    Code:

    VB.NET-Quellcode

    1. Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
    2. Dim Start As String = DateAdd("s", -CDbl(GetTickCount / 1000), Now)
    3. Label1.Text = Start
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!
    Das ist eine VB 6 Dekleration, As Long-> As integer...
    DateAdd ist auch noch aus VB 6 Zeiten...

    VB.NET-Quellcode

    1. Dim start As String = Now.Subtract(New TimeSpan(0,0,0,System.Environment.TickCount \ 1000)).ToString("")

    In Anführungszeichen eventuelle Formatierungen, ansonsten weglassen...

    Gibt evtl. auch noch eine kürzere/schönere Lösung aber immerhin ists jetzt .Net :P
    Ich wollte auch mal ne total überflüssige Signatur:
    ---Leer---
    Naja, hatte mir den Code rausgesucht und der
    funktioniert ja auch...

    Aba deiner ist besser :P
    "Life isn't about winning the race. Life is about finishing the race and how many people we can help finish the race." ~Marc Mero

    Nun bin ich also auch soweit: Keine VB-Fragen per PM! Es gibt hier ein Forum, verdammt!