Startseite ¦  was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews ¦  sonstiges
kylix ¦  tutorials ¦  online shop ¦  fotos ¦  Add&Win Gewinnspiel


Willkommen Gast. Bitte einloggen oder registrieren.
04.02.2012, 09:14:35
Übersicht Hilfe Suche Einloggen Registrieren

+  SwissDelphiCenter Forum
|-+  German Forums
| |-+  WinAPI Forum
| | |-+  LDAP postOfficeBox
« vorheriges nächstes »
Seiten: [1] Drucken
Autor Thema: LDAP postOfficeBox  (Gelesen 2083 mal)
bani
Jr. Member
**
Offline Offline

Beiträge: 74


« am: 02.12.2009, 11:37:03 »

Hallo zusammen

Ich drehe bald durch. Seit Tagen durchsuche ich das Internet, finde aber einfach keine Lösung.

Ich greife mit ADOQuery auf LDAP zu. Das funktioniert soweit. Im Sql habe ich postOfficeBox drin.

Code:
SELECT ADsPath, title, SN , givenName , postOfficeBox
FROM 'LDAP://meineDom
WHERE objectClass='person'  and (objectClass='user' or objectClass='contact')
order By SN

Das Ganze will ich nun in einem ClientDataSet. Das geht auch mit allen TWideStringField-Feldern. Alle Felder, die ein TVariantField sind funktionieren nicht. Hier kommt beim Import der Felder die Meldung: Typ für Feld 'postOfficeBox' ist unbekannt. Ich finde keine Lösung.

Nun dachte ich, dass ich ein berechnetes Feld einfüge und bei  OnCalcFields einfach den Wert direkt mir dem Zugriff GetObject(AdsPath) As IADs; mit dem AdsPath, den ich ja bereits habe, hole.
Auch hier komme ich nicht weiter. Kann mir jemand sagen wir ich die Werte von Variant-Felden lesen kann zB. den Wert von postOfficeBox.
Im Voraus besten Dank und Grüsse
Bani
Gespeichert
bani
Jr. Member
**
Offline Offline

Beiträge: 74


« Antworten #1 am: 04.12.2009, 13:54:13 »

Hallo

Ich gebe hier nun meine Lösung bekannt. Vielleicht hat jemand noch Verbesserungsvorschläge.

Ich habe nun im ADOQuery die Felder, die ich direkt im Gris Anzeige angegeben und diese ins ClientDataset importiert:

Code:
SELECT ADsPath, SN , givenName , TelephoneNumber, pager, Department, Company, l
FROM 'LDAP://MeineDomain'
WHERE objectClass='person'  and (objectClass='user' or objectClass='contact')
order By SN

Danach habe ich im AfterScroll folgenden Code eingebaut:
Code:
  edName.Text              := tbDatenSN.asString;
  edVorname.Text           := tbDatengivenName.asString;
  edFirma.Text             := tbDatenCompany.asString;
  edOrt.Text               := tbDatenl.asString;
  edFirmaTel1.Text         := tbDatenTelephoneNumber.asString;
  edFirmaFunk1.Text        := tbDatenpager.asString;
  edAbteilung.Text         := tbDatenDepartment.asString;

  // Felder die herangezogen werden
  edTitel.Text             := GetDetail(tbDatenADsPath.asString,  'title', fTyp);
  edPostfach.Text          := GetDetail(tbDatenADsPath.asString,  'postOfficeBox', fTyp);
  edStrasse.Text           := GetDetail(tbDatenADsPath.asString,  'streetAddress', fTyp);
  edPLZ.Text               := GetDetail(tbDatenADsPath.asString,  'postalCode', fTyp);
  edKanton.Text            := GetDetail(tbDatenADsPath.asString,  'st', fTyp);
  edLandKurz.Text          := GetDetail(tbDatenADsPath.asString,  'c', fTyp);
  edLandLang.Text          := GetDetail(tbDatenADsPath.asString,  'co', fTyp);
  edBuero.Text             := GetDetail(tbDatenADsPath.asString,  'physicalDeliveryOfficeName', fTyp);
  edFirmaFax1.Text         := GetDetail(tbDatenADsPath.asString,  'facsimileTelephoneNumber', fTyp);
  edFirmaNatel1.Text       := GetDetail(tbDatenADsPath.asString,  'mobile', fTyp);
  edFirmaMail1.Text        := GetDetail(tbDatenADsPath.asString,  'mail', fTyp);
  edFirmaWWW.Text          := GetDetail(tbDatenADsPath.asString,  'wWWHomePage', fTyp);
  memPrivatAdresse.Text    := GetDetail(tbDatenADsPath.asString,  'homePostalAddress', fTyp);
  memFirmaPostAdresse.text := GetDetail(tbDatenADsPath.asString,  'postalAddress', fTyp);
  edPrivatTel1.Text        :=GetDetail(tbDatenADsPath.asString,  'homePhone', fTyp);
  memInfo.Text             := GetDetail(tbDatenADsPath.asString,  'info', fTyp);
  memBemerkung.Text        := GetDetail(tbDatenADsPath.asString,  'description', fTyp);
  edLastMut.Text           := GetDetail(tbDatenADsPath.asString,  'ModifyTimestamp', fTyp);
  laAnzeigeName.Caption    := GetDetail(tbDatenADsPath.asString,  'cn', fTyp);

Hier den Code zum getDetail:
Code:
function TForm1.GetDetail(ADsPath, Wert: String; var FTyp: TFieldType): wideString;
var
  ADs                       : IADs;
  Connect                   : TADOConnection;
  Data                      : TADODataSet;
  Cmd                       : TADOCommand;
  s, strQuery, strTxt, strVal  : String;
  arrVar                    : Array of variant;
  i                         : integer;
begin
  result := '';
  // gem ADsPath suchen, wenn leer Abbrechen...
  if trim(ADsPath) = '' then exit;

  Connect := TADOConnection.Create(nil);
  Data    := TADODataSet.Create(nil);
  Cmd     := TADOCommand.Create(nil);

  // Object holen.
  ADs   := GetObject(AdsPath) As IADs;

  // Verbindung öffnen.
  Connect.Provider    := 'ADsDSOObject';
  Connect.LoginPrompt := False;
  Connect.Open;

  // SQL-String creieren.
  strQuery := '<' + ADsPath + '>;(objectClass=*);' + wert + ';subtree';

  Cmd.Connection  := Connect;
  Cmd.ParamCheck  := False;
  Cmd.CommandText := strQuery;
  Data.Recordset  := Cmd.Execute;

  Data.First;
  // ftUnknown, ftString, ftSmallint, ftInteger, ftWord
  // ftBoolean, ftFloat, ftCurrency, ftBCD, ftDate, ftTime, ftDateTime
  // ftBytes, ftVarBytes, ftAutoInc, ftBlob, ftMemo, ftGraphic, ftFmtMemo
  // ftParadoxOle, ftDBaseOle, ftTypedBinary, ftCursor, ftFixedChar, ftWideString
  // ftLargeint, ftADT, ftArray, ftReference, ftDataSet, ftOraBlob, ftOraClob
  // ftVariant, ftInterface, ftIDispatch, ftGuid, ftTimeStamp, ftFMTBcd
  // ftFixedWideChar, ftWideMemo, ftOraTimeStamp, ftOraInterval

  fTyp := data.FieldByName(Wert).DataType;

  case fTyp of

     ftString, ftWideString, ftBlob, ftMemo, ftFmtMemo, ftWideMemo,
     ftFixedChar, ftFixedWideChar, ftSmallint, ftInteger, ftLargeint, ftWord,
     ftFloat, ftCurrency, ftBCD, ftBytes, ftAutoInc
                               : result := data.FieldByName(Wert).AsString;

     ftDate                    : result := DateToStr(data.FieldByName(Wert).AsDateTime);
     ftTime                    : result := TimeToStr(data.FieldByName(Wert).AsDateTime);
     ftDateTime                : result := DateTimeToStr(data.FieldByName(Wert).AsDateTime);
     ftBoolean                 : result := BoolToStr(data.FieldByName(Wert).AsBoolean);
     ftVarBytes                : begin
                                   s := (data.FieldByName(Wert).AsString);

                                   if s <> '' then
                                   begin
                                     if Odd(length(s)) then
                                       s := '0'+s;
                                     SetLength(Result, Length(s) div 2);
                                     HexToBin(Pchar(s), PChar(Result), Length(Result));
                                   end;
                                 end;



     ftVariant, ftArray        : begin
                                  // Daten durchsuchen
                                   while (Data <> nil) and not (Data.Eof) do begin
                                     try
                                       arrVar :=    data.FieldByName(Wert).Value;
                                       Data.Next;
                                     except
                                       Data.Next;
                                     end;
                                   end;

                                   for i := 0 to Length(arrVar) - 1 do
                                   begin
                                     strTxt := arrVar[i];
                                     if trim(strTxt) = '' then Continue;

                                     strVal := trim(MidStr(strTxt,Pos('=',strTxt)+1,Pos(',',strTxt)-Pos('=',strTxt)-1));

                                     // Leere Values auslasen
                                     if trim(strVal) <> '' then
                                     begin
                                       if result <> '' then
                                         // Zeilenumbruch einfügen.
                                         result := result +  sLineBreak;

                                       result := result +  strVal;
                                     end;
                                   end;
                                 end;

  end;

  Data.Free;
  Cmd.Free;
  Connect.Free;
  ADs := nil;
end;

function TForm1.MidStr(Const Str: String; From, Size: Word): String;
begin
  MidStr := Copy(Str, From, Size)
end;

Gruss
Bani
Gespeichert
bani
Jr. Member
**
Offline Offline

Beiträge: 74


« Antworten #2 am: 04.12.2009, 13:56:38 »

Hallo zusammen

Anbei noch eine Liste mit allen Feldern die ich gefunden habe:

title
sn
givenName
company
postOfficeBox
streetAdress
postalCode
l
st
c
co
department
physicalDeliveryOfficeName
telephoneNumber
facsimileTelephoneNumber
mobile
pager
mail
wWWHomePage
homePostalAddress
postalAddress
homePhone
otherHomePhone
info
description
ModifyTimestamp
cn
ExtensionAttribute1
accountExpires
accountNameHistory
aCSPolicyName
Address
adminCount
adminDescription
adminDisplayName
altRecipient
altSecurityIdentities
assistant
attributeCertificate
attributeCertificateAttribute
audio
authOrig
autoReply
autoReplyMessage
badPasswordTime
badPWDCount
businessCategory
businessRoles
carLicense
codePage
comment
controlAccessRights
countryCode
dBCSPwd
defaultClassStore
deletedItemFlags
delivContLength
deliverAndRedirect
deliveryMechanism
delivExtContTypes
departmentNumber
desktopProfile
destinationIndicator
displayName
displayNamePrintable
division
dlMemberRule
dLMemDefault
dLMemRejectPerms
dlMemSubmitPerms
dnQualifier
dSASignature
dynamicLDAPServer
employeeID
employeeNumber
employeeType
enabledProtocols
expirationTime
Extendet
extensionAttribute10
extensionAttribute11
extensionAttribute12
extensionAttribute13
extensionAttribute14
extensionAttribute15
ExtensionAttribute2
ExtensionAttribute3
ExtensionAttribute4
ExtensionAttribute5
ExtensionAttribute6
extensionAttribute7
extensionAttribute8
extensionAttribute9
extensionData
extensionName
flags
folderPathname
formData
fSMORoleOwner
garbageCollPeriod
gecos
generationQualifier
gidNumber
groupAttributes
groupMembershipSAM
groupPriority
groupsToIgnore
groupType
heuristics
hideDLMembership
homeDirectory
homeDrive
homeMDB
homeMTA
houseIdentifier
importedFrom
initials
internationaliSDNNumber
internetEncoding
ipPhone
isCriticalSystemObject
jpegPhoto
kMServer
labeledURI
language
languageCode
lastKnownParent
lastLogoff
lastLogon
lastLogonTimestamp
legacyExchangeDN
lmPwdHistory
localeID
lockoutTime
loginShell
logonCount
logonHours
logonWorkstation
mailNickName
managedBy
manager
mAPIRecipient
maxStorage
mDBOverHardQuotaLimit
mDBOverQuotaLimit
mDBStorageQuota
mDBUseDefaults
member
memberOf
memberUID
mhsORAddress
middleName
msCOM-UserPartitionSetLink
msDRM-IdentityCertificate
msExchADCGlobalNames
msExchALObjectVersion
msExchAssistantName
msExchControllingZone
msExchCustomProxyAddresses
msExchExpansionServerName
msExchFBURL
msExchHideFromAddressLists
msExchHomeServerName
msExchHouseIdentifier
msExchIMACL
msExchIMAddress
msExchIMAPOWAURLPrefixOverride
msExchIMMetaPhysicalURL
msExchIMPhysicalURL
msExchIMVirtualServer
msExchInconsistentState
msExchLabeledURI
msExchMailboxFolderSet
msExchMailboxGuid
msExchMailboxSecurityDescriptor
msExchMailboxURL
msExchMasterAccountSid
msExchOmaAdminWirelessEnable
msExchOriginatingForest
msExchPfRootURL
msExchPoliciesExcluded
msExchPolicyEnabled
msExchPolicyOptionList
msExchPreviousAccountSid
msExchProxyCustomProxy
msExchQueryBaseDN
msExchRecipLimit
msExchRequireAuthToSendTo
msExchResourceGUID
msExchResourceProperties
msExchTUIPassword
msExchTUISpeed
msExchTUIVolume
msExchUnmergedAttsPt
msExchUseOAB
msExchUserAccountControl
msExchVoiceMailboxID
msIIS-FTPDir
msIIS-FTPRoot
mSMQDigesDigetstsMig
mSMQDigests
mSMQSignCertificates
mSMQSignCertificatesMig
msNPAllowDialin
msNPCallingStationID
msRADIUSCallbackNumber
msRADIUSFramedIPAddress
msRADIUSFramedRoute
msRADIUSServiceType
msRASSavedCallbackNumber
msRASSavedFramedIPAddress
msRASSavedFramedRoute
msSFU30Name
msSFU30NisDomain
msSFU30PosixMember
networkAddress
nonSecurityMember
notes
nTGroupMembers
nTPwdHistory
nTSecurityDescriptor
o
objectCategory
objectClass
objectVersion
oOfReplyToOriginator
operatorCount
otherFacsimileTelephoneNumber
otherIpPhone
otherLoginWorkstations
otherMailbox
otherMobile
otherPager
otherTelephone
otherWellKnownObjects
ou
owner
personalPager
personalTitle
photo
pOPCharacterSet
pOPContentFormat
preferredLanguage
preferredOU
prefferredDeliveryMethod
primaryGroupID
primaryInternationalISDNNumber
primaryTelexNumber
profilePath
protocolSettings
proxyAddresses
publicDelegates
pwdLastSet
registeredAddress
replicatedObjectVersion
replicationSensitivity
replicationSignature
reportToOriginator
reportToOwner
revision
rid
roomNumber
sAMAccountName
sAMAccountType
scriptPath
secretary
securityIdentifier
securityProtocol
seeAlso
serialNumber
servicePrincipalName
shadowExpire
shadowFlag
shadowInactive
shadowLastChange
shadowMax
shadowMin
shadowWarning
showInAddressBook
ShowInAdvancedViewOnly
sIDHistory
street
submissionContLength
supplementalCredentials
supportedAlgorithms
targetAddress
telephoneAssistant
teletexTerminalIdentifier
telexNumber
terminalServer
textEncodedORAddress
thumbnailLogo
thumbnailPhoto
uid
uidNumber
unauthOrig
unicodePwd
unixHomeDirectory
unixUserPassword
unmergedAtts
url
userAccountControl
userCert
userCertificate
userParameters
userPassword
userPKCS12
userPrincipalName
userSharedFolder
userSMIMECertificate
userWorkstations
USNIntersite
uSNSource
versionNumber
wbemPath
x121Address
x500uniqueIdentifier

Gruss

Bani
Gespeichert
bani
Jr. Member
**
Offline Offline

Beiträge: 74


« Antworten #3 am: 14.12.2009, 12:29:50 »

Hallo und guten Tag

Ich lese aus LDAP ein jpegPhoto in ein Array of Byte ein.
Nun möchte ich dies in TImage anzeigen. Ich habe schon viele Codeschnippsel aus dem Web versucht. Es klappt einfach nicht. Kann mir jemand erklären, wie ich das machen muss?

Code:
var
arr : Array of Byte;
begin
  user := GetObject(tbDatenADsPath.asString) As IADsUser;
 try

   arr := user.get('jpegPhoto');

Das Array ist gefüllt, also ich habe die Daten...
Code:
(255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 2, 1, 1, 44, 1, 44, 0, 0, 255, 225, 9, 74, 69, 120, 105, 102, 0, 0, 77, 77, 0, 42, 0, 0, 0, 8, 0, 7, 1, 18, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 1, 26, 0, 5, 0, 0, 0, 1, 0, 0, 0, 98, 1, 27, 0, 5, 0, 0, 0, 1, 0, 0, 0, 106, 1, 40, 0, 3, 0, 0, 0, 1, 0, 2, 0, 0, 1, 49, 0, 2, 0, 0, 0, 28, 0, 0, 0, 114, 1, 50, 0, 2, 0, 0, 0, 20, 0, 0, 0, 142, 135, 105, 0, 4, 0, 0, 0, 1, 0, 0, 0, 164, 0, 0, 0, 208, 0, 45, 198, 192, 0, 0, 39, 16, 0, 45, 198, 192, 0, 0, 39, 16, 65, 100, 111, 98, 101, 32, 80, 104, 111, 116, 111, 115, 104, 111, 112, 32, 67, 83, 51, 32, 87, 105, 110, 100, 111, 119, 115, 0, 50, 48, 48, 57, 58, 48, 50, 58, 49, 48, 32, 48, 55, 58, 53, 51, 58, 53, 50, 0, 0, 0, 0, 3, 160, 1, 0, 3, 0, 0, 0, 1, 255, 255, 0, 0, 160, 2, 0, 4, 0, 0, 0, 1, 0, 0, 3, 59, 160, 3, 0, 4, 0, 0, 0, 1, 0, 0, 0, 237, 0, 0, 0, 0, 0, 0, 0, 6, 1, 3, 0, 3, 0, 0, 0, 1, 0, 6, 0, 0, 1, 26, 0, 5, 0, 0, 0, 1, 0, 0, 1, 30, 1, 27, 0, 5, 0, 0, 0, 1, 0, 0, 1, 38, 1, 40, 0, 3, 0, 0, 0, 1, 0, 2, 0, 0, 2, 1, 0, 4, 0, 0, 0, 1, 0, 0, 1, 46, 2, 2, 0, 4, 0, 0, 0, 1, 0, 0, 8, 20, 0, 0, 0, 0, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 72, 0, 0, 0, 1, 255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 2, 0, 0, 72, 0, 72, 0, 0, 255, 237, 0, 12, 65, 100, 111, 98, 101, 95, 67, 77, 0, 2, 255, 238, 0, 14, 65, 100, 111, 98, 101, 0, 100, 128, 0, 0, 0, 1, 255, 219, 0, 132, 0, 12, 8, 8, 8, 9, 8, 12, 9, 9, 12, 17, 11, 10, 11, 17, 21, 15, 12, 12, 15, 21, 24, 19, 19, 21, 19, 19, 24, 17, 12, 12, 12, 12, 12, 12, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 1, 13, 11, 11, 13, 14, 13, 16, 14, 14, 16, 20, 14, 14, 14, 20, 20, 14, 14, 14, 14, 20, 17, 12, 12, 12, 12, 12, 17, 17, 12, 12, 12, 12, 12, 12, 17, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 255, 192, 0, 17, 8, 0, 46, 0, 160, 3, 1, 34, 0, 2, 17, 1, 3, 17, 1, 255, 221, 0, 4, 0, 10, 255, 196, 1, 63, 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 1, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 0, 1, 4, 1, 3, 2, 4, 2, 5, 7, 6, 8, 5, 3, 12, 51, 1, 0, 2, 17, 3, 4, 33, 18, 49, 5, 65, 81, 97, 19, 34, 113, 129, 50, 6, 20, 145, 161, 177, 66, 35, 36, 21, 82, 193, 98, 51, 52, 114, 130, 209, 67, 7, 37, 146, 83, 240, 225, 241, 99, 115, 53, 22, 162, 178, 131, 38, 68, 147, 84, 100, 69, 194, 163, 116, 54, 23, 210, 85, 226, 101, 242, 179, 132, 195, 211, 117, 227, 243, 70, 39, 148, 164, 133, 180, 149, 196, 212, 228, 244, 165, 181, 197, 213, 229, 245, 86, 102, 118, 134, 150, 166, 182, 198, 214, 230, 246, 55, 71, 87, 103, 119, 135, 151, 167, 183, 199, 215, 231, 247, 17, 0, 2, 2, 1, 2, 4, 4, 3, 4, 5, 6, 7, 7, 6, 5, 53, 1, 0, 2, 17, 3, 33, 49, 18, 4, 65, 81, 97, 113, 34, 19, 5, 50, 129, 145, 20, 161, 177, 66, 35, 193, 82, 209, 240, 51, 36, 98, 225, 114, 130, 146, 67, 83, 21, 99, 115, 52, 241, 37, 6, 22, 162, 178, 131, 7, 38, 53, 194, 210, 68, 147, 84, 163, 23, 100, 69, 85, 54, 116, 101, 226, 242, 179, 132, 195, 211, 117, 227, 243, 70, 148, 164, 133, 180, 149, 196, 212, 228, 244, 165, 181, 197, 213, 229, 245, 86, 102, 118, 134, 150, 166, 182, 198, 214, 230, 246, 39, 55, 71, 87, 103, 119, 135, 151, 167, 183, 199, 255, 218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0, 245, 84, 146, 73, 37, 41, 36, 146, 73, 74, 73, 36, 146, 82, 146, 92, 239, 214, 236, 239, 172, 120, 127, 100, 253, 135, 75, 174, 223, 234, 122, 251, 106, 245, 98, 61, 63, 75, 250, 159, 74, 197, 202, 101, 253, 112, 250, 237, 128, 89, 246, 218, 254, 207, 234, 73, 96, 182, 141, 187, 182, 198, 237, 179, 253, 100, 9, 240, 45, 238, 95, 225, 153, 121, 136, 70, 112, 158, 47, 93, 212, 37, 63, 214, 122, 127, 169, 79, 166, 164, 188, 239, 173, 125, 122, 235, 53, 12, 11, 112, 221, 93, 77, 202, 195, 101, 214, 176, 176, 56, 11, 119, 221, 77, 187, 55, 203, 182, 110, 167, 216, 187, 158, 147, 145, 110, 87, 74, 194, 202, 184, 131, 109, 248, 245, 89, 97, 2, 6, 231, 177, 175, 126, 159, 214, 114, 64, 219, 31, 49, 200, 230, 193, 142, 25, 50, 112, 212, 201, 136, 0, 250,...
Hier komme ich nicht weiter...

ich versuche
Code:
   arr := user.get('jpegPhoto');

  mStream := TMemoryStream.create;
  mStream.write(arr[0], length(arr));
  mStream.Position := 0;


Doch mStream ist immer leer....

Danke und Gruss
bani
« Letzte Änderung: 14.12.2009, 14:37:02 von bani » Gespeichert
bani
Jr. Member
**
Offline Offline

Beiträge: 74


« Antworten #4 am: 15.12.2009, 13:47:08 »

Ich antworte mir halt wieder einmal selbst...

ins Uses aufnehmen: jpeg
Code:
var
  user    : IADsUser;       // User-Object
  mStream : TMemoryStream;
  arr : Array of Byte;
  b       : TJPEGImage;
begin
  user := GetObject(tbDatenADsPath.asString) As IADsUser;
 
  b       := nil;
  arr     := user.get('jpegPhoto');
  mStream := TMemoryStream.create;
  try
    mStream.write(arr[0], length(arr));
    mStream.Position := 0;

    b := TJPEGImage.Create;
    b.LoadFromStream(mStream);

    ImPhoto.Picture.Assign(b);
finally
  mStream.Free;
  b.Free;
end;


So funktioniert es

Mit bestem Dank an: Blup von www.delphipraxis.net
Gespeichert
Seiten: [1] Drucken 
« vorheriges nächstes »
Gehe zu:  


Einloggen mit Benutzername, Passwort und Sitzungslänge

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006, Simple Machines LLC Prüfe XHTML 1.0 Prüfe CSS