Dynamics AX 2009:如何从 AOS 上的批处理作业进行 FTP
经过多次搜索 AX 中 FTP 文件的方法后,我很高兴发现了 WinInet 类,它或多或少只是同名 .DLL 的包装器。我以为我的问题已经解决了!然而,我并不知道该类有一个主要的致命弱点——它不能批量运行(在服务器上)。
有人能指出我正确的方向吗?具体来说,我想在服务器运行的批处理作业中将文件上传(FTP put)到另一台服务器(作为对相关文件具有管理员权限的服务用户运行)。有人吗?
After quite a few searches for ways to FTP files in AX, I was happy to discover the WinInet class, which is more or less just a wrapper for the .DLL of the same name. I thought my problems were solved! I was not aware, however, that the class had a major Achilles heel -- it doesn't run in batch (on a server).
Can anybody point me in the right direction? Specifically, I want to upload (FTP put) a file to another server in a server-run batch job (running as a service user with admin rights to the file in question). Anybody?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Axaptapedia 中还有另一个使用 .NET 类进行 FTP 的示例。它与 10p 的示例代码有很大不同,值得一看...
根据我自己的经验,我最终编写并从命令行调用一个 bat 文件来传递 ftp 命令,因为我们需要使用特殊的 FTP 客户端!以下是使用 shell 脚本的两个示例 - Net Time && 运行进程。
There is another example of using .NET classes for FTP in Axaptapedia. It is different enough from 10p's example code to take a look...
In my own experience I ended up writing and then calling a bat file from the command line to pass in ftp commands as we needed to use a special FTP client! Here are two examples of using shell scripting - Net Time && Run a Process.
在 AX 中使用 .NET 类,例如,以下代码登录到 FTP 服务器并重命名其中的文件:
这只是一个示例,但请随意使用任何标准 FTP 命令稍微简化此代码。如果这个概念不清楚,请告诉我。
Use .NET classes in AX, e.g. following code logs into the FTP server and renames the file there:
This is just an example but feel free to use any standard FTP command slightly mpdifying this code. Let me know if the concept is unclear.