Login  
Search All Forums
Dart Home | PowerTCP Web for ActiveX | Custom Development Reply | PowerTCP Web for ActiveX Topics | Forums   
AuthorForum: PowerTCP Web for ActiveX
Topic: Saving images with WebTool in C#
fjameel
fjameel@goodepartners.com

From: NYC, NY USA
Posts: 4
Member Since: 09/17/04
posted September 17, 2004 11:29 AM

We are trying to duplicate the functionality of saving images from a webpage using the example on your webpage (in VB 6). We are having no luck referencing a webtool in c#. The documentation says it is compatible with .net. Is there an example in c# somewhere for this purpose.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted September 17, 2004 11:40 AM

Hi,
Yes, it can be used in C#, though the syntax is not always obvious.
Below are examples of a very simple Post and Get.
-ken

private void button1_Click(object sender, System.EventArgs e)
{
object data = "Name=Ken";
object content = "";
object headers = null;
object respHeaders = null;
Http1.Url = "www.dart.com/PostSample.asp";
Http1.Post(ref data, ref headers, ref content, ref respHeaders, "", "");
Debug.WriteLine(content.ToString());
}

private void button2_Click(object sender, System.EventArgs e)
{
object content = "";
object headers = null;
Http1.Url = "www.dart.com/default.asp";
Http1.Get(ref content, ref headers, "", "");
Debug.WriteLine(content.ToString());
}
fjameel
fjameel@goodepartners.com

From: NYC, NY USA
Posts: 4
Member Since: 09/17/04
posted September 17, 2004 11:51 AM

Thanks that helped a lot, we are still stuck with converting this
WebPage1.Source = WebASP1.Response.Body.ReadString(); The read string method requires an int ..... Cant figure out what this is.
K M Drake



From: Utica, NY USA
Posts: 3406
Member Since: 07/14/00
posted September 17, 2004 1:21 PM

Hi,
This is actually a Web Enterprise question, and should go under the topic for that Tool.

To answer, the int is the length of the data you want to extract, starting at WebASP1.Response.Body.Position.

You probably want to do something like:
WebPage1.Source = WebASP1.Response.Body.ReadString(WebASP1.Response.Body.Size);

-ken
Reply | PowerTCP Web for ActiveX Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX