Delphi 项目 - 调试 x 发行版本 - Indy 库的问题
我们将应用程序从 Delphi 7 移植到 Delphi 2007,并将服务器和客户端之间的通信从 Indy 9 移植到 Indy 10。
检查用户名和密码的部分现在给出了一些非常奇怪的结果: 如果我使用 Delphi 2007 的虚拟机(开发环境),我可以毫无问题地登录服务器应用程序。
如果我生成可执行文件并尝试在虚拟机外部运行它,我会得到错误的密码。 检查密码的代码使用 TIdTCPConnection.ReadString 读取数据 - 对于 Delphi 7 和 Delphi 2007 上的 TidTCPConnection.Socket.ReadString 。
我猜测这与 Delphi 2007 版本上的 ReadString 方法的额外参数有关,但是,为什么我在调试模式下运行应用程序时可以登录 - 要么运行服务器处于调试状态或客户端处于调试状态,但无法连接到我的 Delphi 2007 环境之外。
是否有我缺少的 DLL 或其他文件?
任何帮助,即使是指出正确的方向,我们都非常感激 - 从昨天开始我们就一直坚持下去。
已编辑 - 已编辑 - 已编辑 - 已编辑 - 已编辑 - 已编辑:
我已更改此问题的标题,并隔离了仅在应用程序的发布版本中发生的问题。 使用调试版本,包括 TD32、调试信息、本地符号、调试 DCU 等,问题就不会发生。
我测试发布版和调试版的机器只安装了 Delphi 7。 使用 Finalbuilder 生成可执行文件的版本有 Delphi 7 和 Delphi 2007(正在使用的编译器版本)。
我有另一个虚拟机,我用它来开发 Delphi 2007 项目 - 在这台机器上生成的任何东西 - 调试版本,也可以正常工作 - 但发布版本 - 没有调试信息,将有相同的密码问题。
We have port an application from Delphi 7 to Delphi 2007 - and the communication between server and client from Indy 9 to Indy 10.
The part that checks the username and password is now giving some really weird results:
If I'm on my Virtual Machine (development environment) with Delphi 2007, I can login into the server application no problem.
If I generate the executables and try to run it outside the virtual machine, I get a wrong password.
The code that checks for the password reads the data using a TIdTCPConnection.ReadString - for Delphi 7 and a
TidTCPConnection.Socket.ReadString on Delphi 2007.
I was guessing this was related, somehow, with the extra parameters on Delphi 2007 version for the ReadString method but then, why I can login when I run the application in Debug mode - either running the server in Debug or the client in Debug but not able to connect outside my Delphi 2007 environment.
Is there any DLL or other file that I am missing here?
Any help, even pointing the right direction, is much appreciated - we are stucked on it since yesterday.
EDITED - EDITED - EDITED - EDITED - EDITED - EDITED:
I have changed the title for this question, and have isolated the problem that is only happening with the release version of the application.
With a debug version, including TD32, debug info, local symbols, debug DCU, etc, the problem just not happen.
The machine where I'm testing the release and debug version only have Delphi 7 installed.
The one generating the executables, with Finalbuilder, have Delphi 7 and Delphi 2007 (the compiler version being used).
I have another virtual machine, that I use to develop Delphi 2007 projects - anything generated on this machine - debug version, works fine as well - but release version - without debug information, will have the same password problem.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试使用 OutputDebugString 或将密码记录到服务器端的文件中,以确保它正确接收。
另外,您使用的是最新版本的 Indy 吗?可能存在与字符串处理有关的修复。
You could try using OutputDebugString or logging the password to a file on the server side, to ensure it is receiving it correctly.
Also, are you using the latest version of Indy? There may be fixes pertaining to string handling.
如果没有看到实际的代码和数据,这真的很难诊断。最有可能的是,当您从 Indy 9 切换到 10 时,您的 Indy 10 代码实际上并未使用与 Indy 9 代码等效的正确功能。请提供更多详细信息。
This is really hard to diagnose without seeing your actual code and data. Most likely, when you made the switch from Indy 9 to 10, your Indy 10 code is not actually using the correct functionality that is equivilent to your Indy 9 code. Please provide more details.