Jump to content

Soji

Members
  • Content Count

    43
  • Joined

  • Last visited

Everything posted by Soji

  1. Hi, I am looking for a Delphi AES encryption/decryption library to decrypt a text which is encrypted using power-shell script. Another application encrypts a text using power-shell and put it into a file. My Delphi application has to read the file and decrypt the string. This is the power-shell script to encrypt ( Powershell encrypt and decrypt ). I want to mimic the function fAESDecrypt() in Delphi. Anyone knows any libraries which can do this? If there is nothing out there which can do it, I am thinking about executing the power-shell from Delphi to decrypt it. I think that should be possible. Thanks in advance, Soji.
  2. Hi, I am trying to rewrite a piece of legacy code which inserts a number of records in a bulk to SQL server tables(Total number of lines is around 200000 across 15 tables). Currently it uses ADO query to insert multiple records one by one. If the number of records are too high then this process takes a lot of time. I was trying to make it faster and came across FireDAC array DML and according to the documentation, inserting 100000 records can be done less than a second! So I implemented it and in my development machine (where application and database resides) it improved a lot. From 8 minutes to less than a minute. But when I tested it on a test environment where application and database resides on different machines connected by a network, performance is worse. (It was taking 10 minutes with ADO and with array DML it takes 15 minutes) I can't figure it out why array DML insert is taking more time than normal record by record insert. Any ideas? Delphi version: Delphi 10.4 SQL Server: 2017 SQL Driver: ODBC DRIVER 17 FOR SQL SERVER Kind regards, Soji.
  3. Soji

    FireDAC array DML performance issue

    Thanks @Anders Melander I did exactly same. I saw that even though it executes in the batch, server side it was inserting slowly. So I used transactions, it inserted super fast.
  4. Soji

    FireDAC array DML performance issue

    Hi Brain, Thanks for your suggestion. But those OLEDB drivers are either not maintained or deprecated. Also FireDAC forces you to use ODBC driver. FireDAC, New OLE DB Driver, and SQL Server I figured out that if I use begin transaction and commit transaction, then the performance increases dramatically. 15 minutes to 1 minute!!! So I am satisfied with this solution and testing now. Kind regards, Soji.
  5. Hi, I am trying to figure out how to connect to office 365 through a proxy server. My application is working well if I connect without a proxy. But now the requirement changed and direct connection to internet is not allowed and I have to use a proxy. I can connect to office 365 from the production machine through proxy using a browser. So the connection setup is good. Now I need to change my application to use a proxy. So I looked around and found that I have to use TIdIOHandlerStack and IdConnectThroughHttpProxy1 to achieve it. But the help document is not that great. So looking for suggestions/help. My code looks like this. type TForm1 = class(TForm) Button1: TButton; IdIMAP: TIdIMAP4; IdConnectThroughHttpProxy1: TIdConnectThroughHttpProxy; IdIOHandlerStack1: TIdIOHandlerStack; Memo1: TMemo; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin IdIMAP.Username := 'test@test.com'; // outlook user name IdIMAP.Password := 'xxxxx'; // outlook user password IdIMAP.Port := 993; // outlook server port IdIMAP.Host := 'outlook.office365.com'; // outlook server IdIMAP.AuthType := iatUserPass; IdConnectThroughHttpProxy1.Host := 'x.x.x.x'; // Proxy server IdConnectThroughHttpProxy1.Port := 1234; // Proxy server port IdIOHandlerStack1.TransparentProxy := IdConnectThroughHttpProxy1; IdIMAP.IOHandler := IdIOHandlerStack1; try Memo1.Lines.Clear; Memo1.Lines.Add('Trying to connect to server...'); if not IdIMAP.Connected then begin if IdIMAP.Connect(false) then Memo1.Lines.Add('Connected to server') else Memo1.Lines.Add('NOT Connected to server') end; Memo1.Lines.Add('Trying to login to server...'); if not(IdIMAP.ConnectionState in [csAuthenticated, csSelected]) then IdIMAP.Login; Memo1.Lines.Add('Logged in to server'); except on E: Exception do begin Memo1.Lines.Add('Error while connecting: ' + E.Message); end; end; end; When I try this, I get "Error while connecting: 403 forbidden error" Thanks for your time, Kind regards, Soji.
  6. @Remy Lebeau: Thanks that worked like a charm... You were really helpful. Thanks for taking time to help me with this.
  7. Thanks @Remy Lebeau for your time. I received a network log from the production server. They said that it is actually connecting to outlook through proxy! See the image below: But I get the "Connection closed Gracefully" exception when I call IdIMAP.Connect(false).
  8. @Remy Lebeau: Thanks for your suggestion. I checked it but we use HTTP. So I used TIdConnectThroughHttpProxy and I investigated a bit more and adjusted code like this: p := TIdConnectThroughHttpProxy.Create(IdIMAP); io := TIdIOHandlerStack.Create(IdIMAP); p.Host :='x.x.x.x'; // Proxy server ip p.port :=1234; // Proxy server port p.Enabled := true; io.TransparentProxy:=p; IdIMAP.IOHandler := io; IdIMAP.Host := 'outlook.office365.com'; IdIMap.Port := 993; IdIMAP.Password := 'Pass123'; Now I get the "Connection closed Gracefully" exception when I call IdIMAP.Connect(false). Thanks for your time, Soji.
  9. No. The proxy doesn't require it's own authentication.
  10. Hi, I am looking for an easy option to set "version information" of multiple projects with in a project group at the same time. Is there any option already available wit the Delphi IDE? Going through each and every project and updating the version information for a particular build configuration is error prone and cumbersome. I have almost 75 projects in a project group. Don't want to click through each and every project and enter the version information for every release. Any best practices or suggestions to handle this situation? I use configuration manager to select a configuration to build all the projects in my development machine. (For release build I use a build server and MSBUILD) Kind regards, Soji.
  11. Thanks @emailx45. I started exactly with same idea sometime back. Then I found some issue when we upgraded Delphi version. The *.dproj file changed and my search and replace failed or did not work with different build configurations. I created a tool to search and replace build version at that time. Thanks for your detailed answer. Much appreciated.
  12. Thanks @Anders Melander. I was also not looking for any utilities. Try to find a best solution within IDE/projects itself.
  13. Thanks for all the inputs. CryptoLib4Pascal worked for me.
  14. @Kas Ob.: I spotted the same. Thanks for pointing it out. Yes. You have to use another package HashLib4Pascal from same authors. I use that package for PKDF2.
  15. I got an interesting message when I tried to upgrade my project from Delphi 10.3 to Delphi 10.4.1. It says I need to add "getit" package!. This is really a strange message. (There is no package named getit in my project group and I am sure I don't have any dependency to a package named getit.)
  16. Soji

    Delphi 10.4.1 upgrade

    Yes. That is right. I already "fixed" it. But it is really strange to say that I have to add "getit" right?
  17. We use an config file to store the database connection string. We are thinking about encrypting the connection string. Is there any best practices to keep the connection string information safe?
  18. It is a legacy application. Sustain mode. So looking for a quick solution.
  19. I have a legacy Delphi app which was running fine on windows server 2008. When the server updated to 2012, the app starts to have a paint issue. There are some big tasks running on a modal form (In main thread). It is big for/while loops. When those tasks runs, the main form turns black and some cases, the border turns white. The correct solution to this is to run the task in threads or use parellel library. But that is a big overhaul and that is not possible to do. I was looking for some quick fix to handle it and I used the following code snippet and it worked: PeekMessage(Msg, 0, 0, 0, PM_NOREMOVE); I have to do this everywhere in the code where big bloat is there. Is there any other solutions available?
  20. Yes. I was about to type the same. It is not same.
  21. I tried that comment. Did not work out well though 😒
  22. Thanks @Attila Kovacs. This is interesting. I will give a try. If I can make it work, then it avoids going through loop by loop and adding the peekmessage.
×