将图片上传到http://tinypic.com/ [英] Upload image to http://tinypic.com/

查看:69
本文介绍了将图片上传到http://tinypic.com/的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请告诉我如何从c#上传图片到此网站?

Please tell me how to upload pictures from c# to this site ?

推荐答案

3秒Google搜索: ^ ]
3 second Google search: http://www.developerfusion.com/code/5717/interacting-with-tinypic-from-c/[^]


避免上载TinyPic(字符串imagetags,字符串文件名){
foxtrot.xray.WebRobot wrobot =新的foxtrot.xray.WebRobot();
foxtrot.xray.Form wform;
foxtrot.xray.Input wtags;
foxtrot.xray.input wimg;
foxtrot.xray.输入网址;
wrobot.Base ="http://tinypic.com/";
wrobot.LoadPage("/");
wform = wrobot.Forms [0];
wtags = wform.GetFieldByName("the_tag");
wimg = wform.GetFieldByName("the_file");
wtags.InputValue = imagetags;
wimg.InputValue =文件名;
wrobot.SubmitForm(wform);
wform = wrobot.Forms [0];
wtags = wform.GetFieldByName("mytag");
wimg = wform.GetFieldByName("myimg");
wurl = wform.GetFieldByName("myurl");
System.Windows.Forms.MessageBox.Show_
(图片上传成功!\ r \ n" +
"HTML链接:" +(string)wtags.InputValue +"\ r \ n" +
"[IMG]标签:" +(string)wimg.InputValue +"\ r \ n" +
图片网址:" +(字符串)wurl.InputValue);
}
void uploadTinyPic(string imagetags, string filename){
foxtrot.xray.WebRobot wrobot = new foxtrot.xray.WebRobot();
foxtrot.xray.Form wform;
foxtrot.xray.Input wtags;
foxtrot.xray.Input wimg;
foxtrot.xray.Input wurl;
wrobot.Base = "http://tinypic.com/";
wrobot.LoadPage("/");
wform = wrobot.Forms[0];
wtags = wform.GetFieldByName("the_tag");
wimg = wform.GetFieldByName("the_file");
wtags.InputValue = imagetags;
wimg.InputValue = filename;
wrobot.SubmitForm(wform);
wform = wrobot.Forms[0];
wtags = wform.GetFieldByName("mytag");
wimg = wform.GetFieldByName("myimg");
wurl = wform.GetFieldByName("myurl");
System.Windows.Forms.MessageBox.Show_
("Image uploaded successfully!\r\n" +
"HTML link: " + (string)wtags.InputValue + "\r\n" +
"[IMG] tag: " + (string)wimg.InputValue + "\r\n" +
"Image URL: " + (string)wurl.InputValue);
}


这篇关于将图片上传到http://tinypic.com/的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆