Interacting with TinyPic from C#

Interacting with TinyPic from C#

The following snippet will demonstrate how to interact with, an image mirroring service, directly from a C# application, using the WebRobot component available from

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 = "";
    wform = wrobot.Forms[0];
    wtags = wform.GetFieldByName("the_tag");
    wimg = wform.GetFieldByName("the_file");
    wtags.InputValue = imagetags;
    wimg.InputValue = filename;
    wform = wrobot.Forms[0];
    wtags = wform.GetFieldByName("mytag");
    wimg = wform.GetFieldByName("myimg");
    wurl = wform.GetFieldByName("myurl");
("Image uploaded successfully!\r\n" +
"HTML link: " + (string)wtags.InputValue + "\r\n" +
        "[IMG] tag: " + (string)wimg.InputValue + "\r\n" +
        "Image URL: " + (string)wurl.InputValue);

You can download a complete project illustrating its usage here, for more convenience.

You might also like...


Fernando Sanchez


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“God could create the world in six days because he didn't have to make it compatible with the previous version.”