APNSoft - Web Controls, components for ASP.NET Home Help Center Contact Us
About UsProductsDownloadsPurchase
Support

Include
Version 1.5



What's New
Overview
Features
Reference Book
Licensing
Support



Set Text Property
Include Page from URL




For example, get 3 images from autos.yahoo.com:

Yahoo! Autos







  • Code Behind

    using APNSoft.WebControls;
    using System.Text.RegularExpressions;
    
    APNSoftInclude APNSoftInclude1 = new APNSoftInclude();
    
    APNSoftInclude1.IncludeFileURL = "http://www.yahoo.com/";
    APNSoftInclude1.RequestURLTimeout = 10000;
    
    string _Result = APNSoftInclude1.Render();
    string ImgsFromSrc = "";
    
    if(Regex.IsMatch(_Result, "<img[^>]*>"))
    {
      ImgsFromSrc +=
        Regex.Matches(_Result, "<img[^>]*>")[1].ToString();
      ImgsFromSrc +=
        Regex.Matches(_Result, "<img[^>]*>")[3].ToString();
      ImgsFromSrc +=
        Regex.Matches(_Result, "<img[^>]*>")[4].ToString();
    }
    
    Response.Write(ImgsFromSrc);
    

You need to set the IncludeFileURL property.


  © 2003-2008 APNSoft. All rights reserved. Table of Contents   Terms of use   Contact Us   Help Center