Bun venit pe SkullBox!

Bine ai venit, Vizitator. Trebuie să te autentifici sau să îţi creezi un cont.
Ai pierdut sau nu ai primit emailul care conţine codul de activare al contului?

Autentifică-te cu numele de utilizator, parola şi precizează durata sesiunii.
  Pagini: [1] 2 3
  Imprimă  
[incepatori][Concurs 4]Uptime  (Vizualizari 2747)
HexString
*

Deconectat Deconectat

Mesaje: 795

WWW
[incepatori][Concurs 4]Uptime, Iul 10, 2007, 15:55

Vreau un program care sa arate Uptimeul Windows-ului : Ora:Minute:Secunde (si milisecunde), EXE-urile se vor posta aici, sursele se vor trimite in privat la mine !!! Cine mai pune altceva pe program decat ce am cerut nu va fii luat in considerare!

Va conta, daca faceti sa arate si milisecundele! Si cat de ordonat si citet e codul sursa!

Concursul tine pana vineri seara, la ora 12 voi pune votarea, si voi face un post cu sursele fiecaruia, va rog sa tineti cont cand votati de ceea ce am cerut !



INAINTE SA VOTATI VA ROG SA VA UITAT LA SURSE!!!

Acum puteti comenta programele, si acest concurs in acest topic!
Memorat

Tutoriale WEB - www.tutoriale-web.com

Puccu - Blogul meu personal
tot_zeu
*

Deconectat Deconectat

Mesaje: 152

[incepatori][Concurs 4]Uptime, Iul 11, 2007, 17:10

http://www.fileshare.ro/357915012.5
Exe
Memorat
DarkByte
*

Conectat Conectat

Mesaje: 2428

WWW
[incepatori][Concurs 4]Uptime, Iul 12, 2007, 00:52

Windows Uptime - exe

Borland Delphi 7.0
Memorat

AdyX
*

Deconectat Deconectat

Mesaje: 1060

WWW
[incepatori][Concurs 4]Uptime, Iul 12, 2007, 09:19

http://rapidshare.com/files/42452845/Project1.exe.html

Made in Delphi.
Memorat
emj
*

Deconectat Deconectat

Mesaje: 468

WWW
[incepatori][Concurs 4]Uptime, Iul 12, 2007, 23:43

Descalificat
Memorat

Gadgetinho - IT cu zambetul pe buze
Noi sa fim sanatosi - Ca boala vine singura - Blog colectiv.
HexString
*

Deconectat Deconectat

Mesaje: 795

WWW
[incepatori][Concurs 4]Uptime, Iul 13, 2007, 00:57

Emj este  descalificat pentru ca a copiat programul (bineinteles nu in totalitate).

Citat
$getdll = DllCall("kernel32.dll", "long", "GetTickCount")
   $ticksSinceBoot = $getdll[0]


Aceste randuri sunt din programul lui, iar searchu-ul pe AutoItScript-Forum m-a dus la aceste randuri :

Citat
$aTSB = DllCall ("kernel32.dll", "long", "GetTickCount")
$ticksSinceBoot = $aTSB[0]


Link catre cererea lui Emj pentru a ii se face programul :

Cod:
http://www.autoitscript.com/forum/index.php?s=&showtopic=49350&view=findpost&p=371869


Mai multe comentarii la OffTopic Concursuri.
Memorat

Tutoriale WEB - www.tutoriale-web.com

Puccu - Blogul meu personal
Xladhenian
*

Deconectat Deconectat

Mesaje: 47

[incepatori][Concurs 4]Uptime, Iul 13, 2007, 08:51

http://files.filefront.com/WindowsUpTimeexe/;8039503;;/fileinfo.html
Memorat
DarkByte
*

Conectat Conectat

Mesaje: 2428

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 01:48

Okey-dokey, il asteptam pe HexString sa ne arate sursele sa putem vota.
Memorat

HexString
*

Deconectat Deconectat

Mesaje: 795

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 09:00

SURSE !!!

Citat

Private Declare Function GetTickCount Lib "kernel32" () As Long


Private Function Timptrecut() As String
Const mili = 0.1
Dim Osecunda As Long
Osecunda = GetTickCount  1000
Timptrecut = Format$((Osecunda  3600) Mod 24, "00 ore ") & Format$((Osecunda Mod 3600)  60, "00 minute ") & Format$((Osecunda Mod 60), "00  secunde ")
      End Function

Private Sub Timer1_Timer()
Label1 = Timptrecut()
End Sub


Citat

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    UpLabel: TLabel;
    Timer1: TTimer;
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var Form1: TForm1;
    start : boolean = false;

implementation

{$R *.dfm}

function Pad(x:byte; s:string):string;      {functie care pune 0-uri in stanga numarului}
var st:string;                              {daca numarul nu are minim X cifre}
begin
  St := S;
  While length(st) < x Do
    St := '0' + St;
  Result := St;
end;

function UpTime: string;
const mss : Integer = 1000;                 {milisecunde pe secunda}
      msm : Integer = 1000 * 60;            {milisecunde pe minut}
      msh : Integer = 1000 * 60 * 60;       {milisecunde pe ora}
      msd : Integer = 1000 * 60 * 60 * 24;  {milisecunde pe zi}
      trm : array[1..5] of string = ('mili','sec','min','ore','zile'); {terminatii}
var t : Longword;
    mili : array[1..5]of integer;
    St : string;
begin
  t := GetTickCount;

  mili[5] := t div msd;
  Dec(t, mili[5] * msd);

  mili[4] := t div msh;
  Dec(t, mili[4] * msh);

  mili[3] := t div msm;
  Dec(t, mili[3] * msm);

  mili[2] := t div mss;
  Dec(t, mili[2] * mss);

  mili[1] := t;

  Result := '';

  For t:=5 downto 1 Do Begin
    If (not Start) and (mili[t]=0) Then Continue
                                   Else Start := True;
    If t = 1 Then St := St + ' ' + Pad(3, IntToStr(mili[1])) + ' ' + trm[1]
             Else St := St + ' ' + Pad(2, IntToStr(mili[t])) + ' ' + trm[t];
                       End;
  Start := False;                    
  Result := St;                    
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  UpLabel.Caption := UpTime;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Timer1.Interval := 7;
  Timer1.Enabled := True;
end;

end.


Citat

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ExtCtrls;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Label1: TLabel;
    Label2: TLabel;
    procedure Timer1Timer(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Timer1Timer(Sender: TObject);
var a: int64;
    h, m, s, ms: longword;
begin
  Label2.Caption:='';
  a:=GetTickCount;
  ms:=a mod 1000;
  a:=a div 1000;
  s:=a mod 60;
  a:=a div 60;
  m:=a mod 60;
  a:=a div 60;
  h:=a;
  if h<>0 then
    Label2.Caption:=IntToStr(h)+' hours  ';
  if m<10 then
    Label2.Caption:=Label2.Caption+'0';
  Label2.Caption:=Label2.Caption+IntToStr(m)+' minutes  ';
  if s<10 then
    Label2.Caption:=Label2.Caption+'0';
  Label2.Caption:=Label2.Caption+IntToStr(s)+' seconds  ';
  if ms<10 then
    Label2.Caption:=Label2.Caption+'0';
  if ms<100 then
    Label2.Caption:=Label2.Caption+'0';
  Label2.Caption:=Label2.Caption+IntToStr(ms)+' miliseconds';
end;

end.


Citat

Unit WindowsUpTimeUnit;

Interface

Uses Windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms,Dialogs, ExtCtrls;

Type TWindowsUpTimeForm = Class(TForm)
       Timer1:TTimer;
       Procedure FormCanResize(Sender:TObject;Var NewWidth,NewHeight:Integer;Var Resize:Boolean);
       Procedure Timer1Timer(Sender:TObject);
      Private
      Public
     End;

Var WindowsUpTimeForm:TWindowsUpTimeForm;

Implementation

{$R *.dfm}

Procedure TWindowsUpTimeForm.FormCanResize(Sender:TObject;Var NewWidth,NewHeight:Integer;Var Resize:Boolean);
Begin
 Resize := False;
End;

Procedure TWindowsUpTimeForm.Timer1Timer(Sender:TObject);
Var T:DWord;
    w,d,h,m,s,ms:Word;
    Txt:String;
Begin
 T := GetTickCount;
 ms := T MOD 1000;
 T := T DIV 1000;
 s := T MOD 60;
 T := T DIV 60;
 m := T MOD 60;
 T := T DIV 60;
 h := T MOD 24;
 T := T DIV 24;
 d := T MOD 7;
 T := T DIV 7;
 w := T;
 Txt := 'Windows Uptime : ' + IntToStr(w) + ' week';
 If (w <> 1)
  Then
   Begin
    Txt := Txt + 's';
   End;
 Txt := Txt + ', ' + IntToStr(d) + ' day';
 If (d <> 1)
  Then
   Begin
    Txt := Txt + 's';
   End;
 Txt := Txt + ', ' + IntToStr(h) + ' hour';
 If (h <> 1)
  Then
   Begin
    Txt := Txt + 's';
   End;
 Txt := Txt + ', ' + IntToStr(m) + ' minute';
 If (m <> 1)
  Then
   Begin
    Txt := Txt + 's';
   End;
 Txt := Txt + ', ' + IntToStr(s) + ' second';
 If (s <> 1)
  Then
   Begin
    Txt := Txt + 's';
   End;
 Txt := Txt + ', ' + IntToStr(ms) + ' milisecond';
 If (ms <> 1)
  Then
   Begin
    Txt := Txt + 's';
   End;
 Txt := Txt + '.';
 Caption := Txt;
End;

End.


Dupa testele facute de mine doar programul lui DarkByte a aratat si zilele Big grin ...
Memorat

Tutoriale WEB - www.tutoriale-web.com

Puccu - Blogul meu personal
AdyX
*

Deconectat Deconectat

Mesaje: 1060

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 10:40

Deci cum am gandit:
tot_zeu, dragut program, ocupa foarte putin, dar nu arata milisecundele
DarkByte, no comment, s-a luat dupa mine rolling on the floor
Xladhenian, interesanta ideea sa pui timpul in bara de titlu

DarkByte si Xladhenian ar fi la egalitate dupa parerea mea, dar votul meu merge catre DarkByte, pentru ca arata si zilele si ca...e DELPHI Smile
Memorat
HexString
*

Deconectat Deconectat

Mesaje: 795

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 10:54

AdyX a trimis DarkByte mai repede deci tu mi-ai spart contu te-ai uitat in prv si te-ai luat dupa el rolling on the floor ... Joking Smile .
Memorat

Tutoriale WEB - www.tutoriale-web.com

Puccu - Blogul meu personal
AdyX
*

Deconectat Deconectat

Mesaje: 1060

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 11:02

Joking?..Asa s-a intamplat...m-ai prins Smile

PS: Uite ca ii dam treaba lui 3Nigma
Memorat
DarkByte
*

Conectat Conectat

Mesaje: 2428

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 14:11

Sunt 9 voturi si doar AdyX a explicat de ce a votat cum a votat. Ii asteptam pe restul sa se explice, altfel vom reincepe poll-ul.

Cititi postul initial al lui HexString, verificati ce anume cere, postati considerentele voastre si votati in consecinta.

Bafta

P.S. AdyX, sry ... o sa votez cu Xladhenian fiindca mi se pare cel mai complet - printre altele, 2 chestii - se ocupa si de saptamani + ca e tot in Delphi Winking
Memorat

Teal
*

Deconectat Deconectat

Mesaje: 602

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 18:36

nu aveam voie sa particip. dar va arat ce am facut. ca mi-a placut ideea.

http://rapidshare.com/files/42903478/uptime.rar

COD SURSA

uptime.au3 - pentru uptime.exe
Cod:
#include

$form=GUICreate("Windows Uptime -  BY TE4L", 510, 395)
GUICtrlSetBkColor($form, 0x191919)


GUICtrlCreatePic("bg.jpg", 0, 0, 0, 0)
$dll = DllOpen("uptime.dll")
$mili_a = DllCall($dll, "uint", "GetUptime")

GUISetFont (30, 400, 1, "Verdana")

$days = GUICtrlCreateInput(-1,8,150,96,90,$ES_READONLY)
$hours = GUICtrlCreateInput(-1,107,150,96,90,$ES_READONLY)
$min = GUICtrlCreateInput(-1,207,150,96,90,$ES_READONLY)
$sec = GUICtrlCreateInput(-1,307,150,96,90,$ES_READONLY)
$miliseconds = GUICtrlCreateInput(-1,406,150,96,90,$ES_READONLY)

GUICtrlSetBkColor($days, 0x191919)
GUICtrlSetBkColor($hours, 0x191919)
GUICtrlSetBkColor($min, 0x191919)
GUICtrlSetBkColor($sec, 0x191919)
GUICtrlSetBkColor($miliseconds, 0x191919)

GUICtrlSetColor($days,0xFFFFFF)
GUICtrlSetColor($hours,0xFFFFFF)
GUICtrlSetColor($min,0xFFFFFF)
GUICtrlSetColor($sec,0xFFFFFF)
GUICtrlSetColor($miliseconds,0xFFFFFF)

GUISetState(@SW_SHOW)

$d =86400000
$h =3600000
$m =60000
$s =1000

While 1
$mili_a = DllCall($dll, "uint", "GetUptime")
$mili=Get($mili_a[0],$d)
If $mili > GUICtrlRead($days) Then
GUICtrlSetData($days, $mili)
EndIf
$mili=$mili_a[0]-GUICtrlRead($days)*$d
$mili=Get($mili,$h)
If $mili > GUICtrlRead($hours) OR $mili=24 Then
GUICtrlSetData($hours, $mili)
EndIf
$mili=$mili_a[0]-GUICtrlRead($days)*$d-GUICtrlRead($hours)*$h
$mili=Get($mili,$m)
If $mili > GUICtrlRead($min) OR $mili=0 Then
GUICtrlSetData($min, $mili)
EndIf
$mili=$mili_a[0]-GUICtrlRead($days)*$d-GUICtrlRead($hours)*$h-GUICtrlRead($min)*$m
$mili=Get($mili,$s)
If $mili > GUICtrlRead($sec) OR $mili=0 Then
GUICtrlSetData($sec, $mili)
EndIf
$mili=$mili_a[0]-GUICtrlRead($days)*$d-GUICtrlRead($hours)*$h-GUICtrlRead($min)*$m-GUICtrlRead($sec)*$s
GUICtrlSetData($miliseconds, $mili)
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then
DllClose($dll)
ExitLoop
EndIf
WEnd

Func Get($mili,$imp)
Return Int($mili/$imp)
EndFunc


uptime.cpp - pentru uptime.dll
Cod:
#include
extern "C" __declspec(dllexport) unsigned long GetUptime()
{
return GetTickCount();
}
BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason,LPVOID reserved)
{
   return true;
}


Si nu aveti nevoie de psd la poza. As fi facut si un icon. Dar nu aveam idei Big grin.

As fi castigat? Big grin  ^:angel:^
Memorat


"Not only the wisdom of centuries — also their madness breaketh
out in us. Dangerous is it to be an heir."

Nietzsche
DarkByte
*

Conectat Conectat

Mesaje: 2428

WWW
[incepatori][Concurs 4]Uptime, Iul 14, 2007, 18:54

Citat
Sunt 9 voturi si doar AdyX a explicat de ce a votat cum a votat. Ii asteptam pe restul sa se explice, altfel vom reincepe poll-ul.

Cititi postul initial al lui HexString, verificati ce anume cere, postati considerentele voastre si votati in consecinta.


Sper ca ati inteles ca poll-ul va fi refacut daca nu va explicati ce v-a facut sa votati cu X sau Y.
Memorat

SkullAds
Ecspert
ReclAmator
* * * * *
Google AdSense

Gen: Bărbat
Mesaje: Multe

Reclama AdSense,
 

 
   


Pagini: [1] 2 3
  Imprimă  
 
Schimbă forumul:  

Ethical hacking and programming community
Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC
Traducerea în limba română © 2006-2007 www.smf.ro