简体   繁体   English

如何以编程方式将文件通过FTP传输到Adcenter?

[英]How to Programatically FTP a file to Adcenter?

I created a data feed for adcenter.com. 我为adcenter.com创建了一个数据Feed。 I know how to upload the file i want to ftp via a FTP client, however, I need to know if I can do this programatically so that is uploads every night. 我知道如何通过FTP客户端上传我要通过ftp传输的文件,但是,我需要知道是否可以通过编程方式执行此操作,以便每晚进行上传。

How could I do this? 我该怎么办?

I assume this could be done in a Batch File. 我认为这可以在批处理文件中完成。

And then i could probably use windows schedulter, but what should be in the batch file? 然后我可能会使用Windows schedulter,但是批处理文件中应该有什么?

You could do it as a console application that runs on schedule, or make it a windows service. 您可以将其作为按计划运行的控制台应用程序来执行,也可以使其成为Windows服务。 You can use the FtpWebRequest to ftp the files up to the server. 您可以使用FtpWebRequest将文件通过ftp传输到服务器。

Hmm I use a wrapper class like this one i found with a quick search.. https://bpm2.svn.codeplex.com/svn/Workflows.Components.FileManipulation/FtpClient.cs 嗯,我使用一个包装类,通过快速搜索发现了它。.https ://bpm2.svn.codeplex.com/svn/Workflows.Components.FileManipulation/FtpClient.cs

After you have that in place you simply make calls to it passing it username password and filename etc.. 将其放置到位后,您只需对其进行调用即可,将用户名密码和文件名等传递给它。

Works great 效果很好

我使用FtpDLX.Net编写了一个Windows服务来做到这一点,因为它既支持端口21上的经典FTP也支持端口22上的安全FTP。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM