|
本帖最后由 tuichu 于 2013-8-28 16:13 编辑
第一种:
[code=csharp]item = new HttpItem()
{
URL = "",//URL 必需项
Referer = "",
Method = "post",//URL 可选项 默认为Get
PostDataType = DotNet.Utilities.PostDataType.FilePath,
Encoding = Encoding.UTF8,
Postdata = Server.MapPath("1.jpg"),
ContentType = "application/x-www-form-urlencoded",
Cookie = cookie
};[/code]
第二种:
[code=csharp]HttpPostedFile postfile = FileUpload1.PostedFile;
Byte[] buffer = new Byte[postfile.InputStream.Length];
postfile.InputStream.Read(buffer, 0, Convert.ToInt32(postfile.InputStream.Length));
item = new HttpItem()
{
URL = "",//URL 必需项
Referer = "",
Method = "post",//URL 可选项 默认为Get
PostDataType = DotNet.Utilities.PostDataType.Byte,
Encoding = Encoding.UTF8,
PostdataByte = buffer,
ContentType = "application/x-www-form-urlencoded",
Cookie = cookie
};
result = http.GetHtml(item);[/code]
两种方式均失败,请大神门赐教
|
|