0

我正在尝试使用 C# 为网站制作自动上传器,但我不知道从哪里开始。例如,我正在尝试为http://www.fileflyer.com/default.aspx创建一个自动上传器。

该网站要求用户检查“我同意服务条款”并要求他输入电子邮件。

我知道 WebClient.UploadFile 可用于上传,但我如何提供和发送电子邮件并选中复选框?

提前感谢,亚当。

4

1 回答 1

0

What you need is to build the same http request as browser does. WebClient class is too light hammer for this. The class you need is HttpWebRequest. This one allowes you to do much more then WebClinet.

The best way to start is to read about HttpWebRequest class. Then you will need to explore structure of request from browser. Use some tool, like Fiddler. Upload some file using your browser and sniff request with Fiddler. Then you can replicate the same request with HttpWebRequest.

The hecked checkbox for example will be in POST data, like: checkboxName=on

于 2012-06-03T10:38:21.460 回答