Jump to content

direktor05

Members
  • Content Count

    21
  • Joined

  • Last visited

Posts posted by direktor05


  1. DAMN, I just discovered there is also TJsonTreeView component. Delphi 10.4. A nono, its a component I installed. Made by some Polish guy at Embarcadero.


  2. No I want to make a tool to create HTML menus. So I want a treeview that will be just like a website menu then export to json and read with javascript. The menu must not only have name, but also link url, onclick event description and parent/child id, stored in tTreeview1.items.data pointer.


  3. Hello,

     

    Is there a TTreeview component that can export items to JSON? Probably not or is very simple, because I also need to export data associated with a node which is in Pointer to Json.

    Any suggestion welcome.


  4. Hello,

     

    Is there a TTreeview component that can export items to JSON? Probably not or is very simple, because I also need to export data associated with a node which is in Pointer to Json.

    Any suggestion welcome.


  5. Hello,

     

    How do I parse this Json:

     

    {"result": [{
          "animals":
          [{
              "id":1,

             "name":

     

     

    So.... I parse Json first:

    jsonobject := TJsonObject.ParseJSONValue(RestResponse.Content) as TJsonObject;

     

    Then I get to "animals":[{"id".... now here gets complicated. How do I parse further to get ID and name? Parse Json further or parse Json Array? Can someone help with some example code please?


  6. This doesnt work:

     

    var
      Source, Dest: TFileStream;
      SrcFile, DestFile: string;
      Start, Stop: cardinal;
      Size: integer;
      SourceKey,NewKey: AESBlock;
      Key: AES128Key;
      SrcBuf, DstBuf: array [0..16383] of byte;
      SrcSize, DstSize: integer;
      MyInBlock, MyOutBlock: AESBlock;
    begin
        Source := TFileStream.Create(txtFile.Text, fmOpenRead);
        DestFile := ExtractFilePath(Application.ExeName) + 'aestemp.enc';
        Dest := TFileStream.Create(DestFile, fmCreate);
        try
          Size:=Source.Read(SourceKey,SizeOf(SourceKey));
          if Size<>SizeOf(SourceKey) then
            raise Exception.Create('Unable to read SourceKey from file.');

          FillChar( Key, SizeOf(Key), 0 );
          Move( PAnsiChar(AnsiString(txtPassword.Text))^, Key, Min( SizeOf( Key ), Length( txtPassword.Text ) ));

          //FillChar( MyInBlock, SizeOf(MyInBlock), 0 );
          //Move(Source.ReadBuffer(SrcBuf,Size), MyInBlock, Min( SizeOf( MyInBLock ), Size ));

          NewKey:=AES128Cipher(SourceKey,Key);
          Dest.WriteBuffer(NewKey,SizeOf(NewKey));
          //AES128Cipher(Source,Key)

          //Dest.WriteBuffer(AES128Cipher(Source,Key),Size);
        finally
          Dest.Free;
          Source.Free;
        end;
        showmessage('Finished');

     


  7. Yes, but its component. Is there any standalone unit? Like this one: https://github.com/stijnsanders/tools - has standalone units in crypto folder, but unfortunately they do not produce accurate results: https://github.com/stijnsanders/tools/tree/master/crypto 

    https://github.com/stijnsanders/tools/blob/master/crypto/aes.pas - when encrypting binary file I get only 16 B file back. But no error when building/compiling.


  8. Hello,

     

    Can someone tell me how to set Lazarus to build for Linux? When I try to set up builder is gives some error that that system.ppu for this target (Linux) was not found. Maybe some libraries for Linux are missing? Where to get them? How to set this up properly?

×