윈도우 사용자 이름
nSize := MAX_COMPUTERNAME_LENGTH + 1;
SetLength(szBuffer,NSize);
GetUserName(Pchar(szBuffer),nSize);
컴퓨터 이름
GetComputerName(Pchar(szBuffer),nSize);
------------------------------------------------------------
프로그램 추가삭제에서 뜨는 목록 보기
const
UNINST_PATH = 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
var
Reg : TRegistry;
SubKey: TSTringList;
I : Integer;
sDisplayName : String;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKeyReadOnly(UNINST_PATH) then
begin
SubKey := TStringList.Create;
try
Reg.GetKeyNames(SubKey);
Reg.CloseKey;
for i := 0 to subKey.Count - 1 do
begin
if Reg.OpenKeyReadOnly(Format('%s\%s', [UNINST_PATH, SubKey[i]])) then
begin
try
sDisplayName := Reg.ReadString('DisplayName');
if ((sDisplayName) <> '') and
(Pos('업데이트',sDisplayName) = 0) and
(Pos('HOTFIX',UpperCase(sDisplayName)) = 0) and
(Pos('핫픽스',sDisplayName) = 0) then
begin
//-------TODO--------
//---------------------
end;
finally
Reg.CloseKey;
end;
end;
end;
finally
SubKey.Free;
end;
end;
finally
Reg.CloseKey;
reg.Free;
end;
end;
//---------아웃룩으로 이메일 보내기---------------
try
OutlookApp := GetActiveOleObject('Outlook.Application');
except
OutlookApp := CreateOleObject('Outlook.Application');
end;
try
MailItem := OutlookApp.CreateItem(olMailItem);
MailItem.Recipients.Add(메일주소);
MailItem.Subject := edt_User.Text + ' Program List';
MailItem.Body := '내용'
MailItem.Attachments.Add(경로);
MailItem.Send;
//MailItem.Display(True);
finally
myAttachments := VarNull;
OutlookApp := VarNull;
end;
//------------------------------------------------
'delphi' 카테고리의 다른 글
Stringgrid의 셀의 폰트와 정렬 (0) | 2023.03.08 |
---|---|
HPF & LPF (0) | 2023.03.08 |
Delphi 11.2 FireMonkey Low Code App Wizard - Error (0) | 2023.03.08 |
Android Apps - Real-time streaming of IP camera images(안드로이드 앱 - IP 카메라 영상 실시간 스트리밍) (0) | 2023.03.08 |
The advantages of Delphi compared to Python (0) | 2023.03.07 |