Read a Delphi TClientDataset Files with .NET

让人想犯罪 __ 提交于 2019-12-30 10:19:07

问题


I need to read Files that are written with the TClientDataset class from Delphi with .NET Code. The Solution mentioned here does not work for me.


回答1:


"A dotNet program that does not run on Windows platform" means to me that you're deploying a Mono application. Possibly on Linux, if that's the case try WINE and see if the Delph app suggested above works as expected. If yes, your problem of leaving the dotnet app machine is solved as both will run on the same hardware without communication through network.

EDIT: since the OP now specified that he's using MonoDroid and Monotouch, and therefore can't use Wine- the remaining options are:

  • Reverse engineer the format (consult a lawyer first to protect yourself from harm)
  • Ask Embarcadero for a definition of the file ( I don't put much hope on it)
  • Modify the Delphi/C++ Application to export the files in XML
  • Create an Delphi application to preprocess those *.cds and export them to XML before sending them to the iOS / Android machine.

Of the four alternatives, the fourth one is possibly the fastest - the best one is the third.

The first one can get you in trouble because of all those laws against rev engineer around the world ( in USA there are DMCA which I heard is very draconian - but IANAL and not even an US-citizen).

The second one is a bet.




回答2:


You need to use Delphi to write a small app to read the cds file and write its contents to a file that you can read from .Net (you choose the appropriate format). You can download free trial versions of Delphi. You can develop the app on a separate pc. You can ftp the input *.cds file from your problematic platform to the pc where this new app will reside. You then run the app and ftp the newly created output file to your problematic platform, then read it with .Net.

You can move files from one platform to another with ftp. No reason to lock yourself into one platform if there's a nice tool you need to use (or about to make!) on another platform. :-)




回答3:


actually original cds binary format IS documented quite extensively in corresponding US patent filed by Hejlsberg/Hansen. I must admit that later borland extended it with few extra features (such as nested datasets support) but basically it is still the very same format and with little digging in midas sources (they released it back in d2010) one can build his own parser as I did



来源:https://stackoverflow.com/questions/5844333/read-a-delphi-tclientdataset-files-with-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!