Napravio sam jedan program za rad u posti,mozete ga uzeti slobodno i doraditi....a treba jos dosta toga
Program za rad isporuke i kartovanja u posti
Zaključano
Zakačeno
program je radjen u delphiju,sa paradox tabelama,jel ima neko zainteresovan,neka kaze...i drustvo iskusnih programera neka daju neke sugestije.pozdrav
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
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
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...
izmenjeno 1 put, poslednji put rambo 12.12.2011. u 19:52
Izmene poruke
- rambo12.12.2011. u 19:52zapis iz teksta poruke
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:
Ovu funkciju jednostavno koristiš ovako:
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):
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;
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;
Potpis
"There is a theory which states that if ever anybody discovers exactly what the
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams
izmenjeno 1 put, poslednji put savkic 12.12.2011. u 18:55
Izmene poruke
- savkic12.12.2011. u 18:55zapis iz teksta poruke
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;
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;
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.
Potpis
"There is a theory which states that if ever anybody discovers exactly what the
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams
tu komponentu nemam,koristim u ovom slucaju delphi 4,a nisam video ni u 7,,,,,mozes da mi kopiras ceo unit...
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.
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.
I da, svakako pređi bar na Delphi 7.
I još nešto. Batali Paradox. Pređi bar na Firebird RDBMS.
Potpis
"There is a theory which states that if ever anybody discovers exactly what the
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams
Universe is for and why it is here, it will instantly disappear and be replaced by
something even more bizarre and inexplicable. There is another theory which states
that this has already happened."
-- Douglas Adams
hvala braco,reseno...koristim tu 4 jer je program koji se koristi na poslu u tom....pa zbog toga....hvala jos jednom