Search results for 'GetFieldByName'. 1 post(s) found.
- 2007/08/27 Interacting With TinyPic From C#
The following snippet will demonstrate how to interact with http://TinyPic.com,an image mirroring service,directly from a C# application,using the WebRobot component available from http://foxtrot-xray.com/web-robot/
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);
}
{
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);
}
Another posts included in "C#"
| How to send binary data through C# CGI app? (0) | 2007/08/27 |
| Simple C# CGI working on Apache (0) | 2007/08/27 |
| Simple Example Of IF/THEN Using C# (0) | 2007/08/28 |
| Creating A Watched Folder With Assigned Events (0) | 2007/08/27 |
| Calling Your Main Thread From A Worker Thread In C# (0) | 2007/08/27 |
| HashTable Tutorial In C# (0) | 2007/08/27 |
| Stack Tutorial In C# (0) | 2007/08/27 |
| Queue Tutorial In C# (0) | 2007/08/27 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 05:10
moneyideas
-
Subject different money making ideas
2010/01/29 13:55
moneyideas
-
Subject different money making ideas
2010/01/31 16:44
moneyideas

Prev

Rss Feed