[ popmilan76 @ 11.12.2011. 08:44 ] @
Napravio sam jedan program za rad u posti,mozete ga uzeti slobodno i doraditi....a treba jos dosta toga |
[ popmilan76 @ 11.12.2011. 08:44 ] @
[ popmilan76 @ 11.12.2011. 08:48 ] @
program je radjen u delphiju,sa paradox tabelama,jel ima neko zainteresovan,neka kaze...i drustvo iskusnih programera neka daju neke sugestije.pozdrav
[ segment @ 12.12.2011. 11:19 ] @
Na prv pogled
1. Zasto vo eden DataModule ne gi smestis site TTable i DataSource (mislam deka ke ti bide polesno) 2. Zasto vo formata DOSTAVAUNOS na ComboBox1Change moras da ispituvas sto e vrednost na comboto pa da go prenesuvas kako parametar mozes PISMADOSTAVA.Query1.Params[0].ASSTRING := ComboBox1.text; Kazi ja prikaznata za delovite sto ne uspevas da se snajdes (kolku mozam ke ti dadam sugestii i ke ti pomognam), Se nadevam deka me razbiras zasto pisuvam na makedonski [ popmilan76 @ 12.12.2011. 15:21 ] @
treba mi mala pomoc oko ovog programa,kako da mi sifra kojom se prijavljujem na kompu,tj na windows,da mi ta sifra izlazi na glavnoj formi(navigatoru),negtde dole pored vremena,ili na panelu....kako to...
[ rambo @ 12.12.2011. 16:17 ] @
Verovatno misliš na Username a ne na šifru, jer se šifra nikada i nigde ne treba prikazivati. Jedan od načina da dobiješ ime trenutno prijavljenog Windows korisnika je pomoću funkcije GetUserName:
Code (delphi): function GetLocalUserName: string; var Count: DWORD; begin Count := 256 + 1; // UNLEN + 1 // set buffer size to 256 + 2 characters SetLength(Result, Count); if GetUserName(PChar(Result), Count) then SetLength(Result, Count) else Result := ''; end; Ovu funkciju jednostavno koristiš ovako: Code (delphi): Label1.Caption := GetLocalUserName Drugi jednostavniji način je da uzmeš JVCL i upotrebiš komponentu TJvComputerInfoEx. Dobićeš veliki broj informacija, a ono što tebe zanima je property Identification.LocalUserName. Da bi na primer popunio labelu svojim korisničkim imenom, napiši: Code (delphi): Label1.Caption := JvComputerInfoEx1.Identification.LocalUserName; [Ovu poruku je menjao rambo dana 12.12.2011. u 19:52 GMT+1] [ popmilan76 @ 12.12.2011. 17:11 ] @
meni treba ovako nesto,ali negde gresim...ne treba mi ime kompjutera,nego username pod kojim sam prijavljen
Code: FUNCTION: GetCurrentUserAndDomain - This function looks up // the user name and domain name for the user account // associated with the calling thread. // // PARAMETERS: szUser - a buffer that receives the user name // pcchUser - the size, in characters, of szUser // szDomain - a buffer that receives the domain name // pcchDomain - the size, in characters, of szDomain // // RETURN VALUE: TRUE if the function succeeds. Otherwise, FALSE and // GetLastError() will return the failure reason. // // If either of the supplied buffers are too small, // GetLastError() will return ERROR_INSUFFICIENT_BUFFER // and pcchUser and pcchDomain will be adjusted to // reflect the required buffer sizes. // //********************************************************************** function GetCurrentUserAndDomain(szUser : PChar; pcchUser : DWORD; szDomain : PChar; pcchDomain: DWORD) : boolean; var fSuccess : boolean; hToken : THandle; ptiUser : PSIDAndAttributes; cbti : DWORD; snu : SID_NAME_USE; begin ptiUser := nil; Result := false; try // Get the calling thread's access token. if (not OpenThreadToken(GetCurrentThread(), TOKEN_QUERY, TRUE, hToken)) then begin if (GetLastError() <> ERROR_NO_TOKEN) then exit; // Retry against process token if no thread token exists. if (not OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY, hToken)) then exit; end; // Obtain the size of the user information in the token. if (GetTokenInformation(hToken, TokenUser, nil, 0, cbti)) then // Call should have failed due to zero-length buffer. Exit else // Call should have failed due to zero-length buffer. if (GetLastError() <> ERROR_INSUFFICIENT_BUFFER) then Exit; // Allocate buffer for user information in the token. ptiUser := HeapAlloc(GetProcessHeap(), 0, cbti); if (ptiUser= nil) then Exit; // Retrieve the user information from the token. if ( not GetTokenInformation(hToken, TokenUser, ptiUser, cbti, cbti)) then Exit; // Retrieve user name and domain name based on user's SID. if ( not LookupAccountSid(nil, ptiUser.Sid, szUser, pcchUser, szDomain, pcchDomain, snu)) then Exit; fSuccess := TRUE; finally // Free resources. if (hToken > 0) then CloseHandle(hToken); if (ptiUser <> nil) then HeapFree(GetProcessHeap(), 0, ptiUser); end; Result := fSuccess; end; [Ovu poruku je menjao savkic dana 12.12.2011. u 18:55 GMT+1] [ rambo @ 12.12.2011. 18:49 ] @
Da li si uopšte probao ono što sam ja napisao? Funkcija GetUserName upravo vraća ime trenutno ulogovanog korisnika, a postoji i GetUserNameEx kojoj možeš da zadaš format u kome želiš da ti vrati informacije. Međutim, to i mnogo više već radi TJvComputerInfoEx komponenta. Ako nisi probao, prvo proveri šta dobijaš onime što sam ti incijalno dao.
[ popmilan76 @ 12.12.2011. 18:57 ] @
tu komponentu nemam,koristim u ovom slucaju delphi 4,a nisam video ni u 7,,,,,mozes da mi kopiras ceo unit...
[ reiser @ 12.12.2011. 19:40 ] @
Oduvek mi je bilo fascinantno sto ljudi koriste ultra stare alate za razvoj ? Delphi 4 je star, pa sigurno, 15+ godina.. Predji na Delphi 7 barem, ako neces na XE.
[ rambo @ 12.12.2011. 20:29 ] @
TJvComputerInfoEx je komponenta u okviru JVCL paketa. JVCL možeš skinuti odavde.
I da, svakako pređi bar na Delphi 7. I još nešto. Batali Paradox. Pređi bar na Firebird RDBMS. [ popmilan76 @ 13.12.2011. 10:00 ] @
hvala braco,reseno...koristim tu 4 jer je program koji se koristi na poslu u tom....pa zbog toga....hvala jos jednom
Copyright (C) 2001-2025 by www.elitesecurity.org. All rights reserved.
|