C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C# Examples

Bounced Mail
Bz2
Character Encoding
CSV
DKIM / DomainKey
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
HTTP
IMAP
Encryption
MHT / HTML Email
MIME
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH
SSH Tunnel
SSH Key
SFTP
Tar Archive
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

Avoiding Outbound Links Matching Patterns

Download Chilkat .NET for 4.0 Framework

Download Chilkat .NET for 64-bit 4.0 Framework (x64)

Download Chilkat .NET for 2.0 / 3.5 Framework

Download Chilkat .NET for 64-bit 2.0 / 3.5 Framework (x64)

Download Chilkat .NET for 1.0 / 1.1 Framework

The spider accumulates outbound links when crawling. Your program may specify any number of "avoid patterns" to prevent any link matching at least one of the wildcarded patterns from being added.

//  The Chilkat Spider component/library is free.
Chilkat.Spider spider = new Chilkat.Spider();

//  First, we'll get the outbound links for a page in the
//  Google directory.  Then we'll add some avoid patterns
//  and then re-fetch, to see it work...

spider.Initialize("directory.google.com");
spider.AddUnspidered("http://directory.google.com/Top/Recreation/Food/Cheese/");

bool success;
success = spider.CrawlNext();

//  Display the outbound links
int i;
string url;
for (i = 0; i <= spider.NumOutboundLinks - 1; i++) {
    textBox1.Text += spider.GetOutboundLink(i) + "\r\n";
}

//  The output:
//  http://www.cheese.com/
//  http://www.cheesediaries.com/
//  http://www.WisDairy.com/
//  http://www.newenglandcheese.com
//  http://www.ilovecheese.com
//  http://www.cheesefromspain.com
//  http://www.realcaliforniacheese.com/
//  http://www.frencheese.co.uk/
//  http://www.cheesesociety.org/
//  http://www.specialcheese.com/queso.htm
//  http://www.franceway.com/cheese/intro.htm
//  http://www.foodsubs.com/Chesfirm.html
//  http://www.cheeseboard.co.uk/
//  http://www.thecheeseweb.com/
//  http://www.vtcheese.com/
//  http://www.coldbacon.com/cheese.html
//  http://www.norwegiancheeses.co.uk/
//  http://www.reluctantgourmet.com/cheese.htm
//  http://www.lancewood.co.za/
//  http://www.switzerlandcheese.ca
//  http://www.frenchcheese.dk/
//  http://www.dolcevita.com/cuisine/cheese/cheese.htm
//  http://cheeseisland.net/
//  http://www.cheestrings.ca/
//  http://www.dreamcheese.co.uk
//  http://hgic.clemson.edu/factsheets/HGIC3506.htm
//  http://www.epicurious.com/cooking/how_to/food_dictionary/entry?id=1815
//  http://www.mousetrapcheese.co.uk
//  http://taquitos.net/yum/gc.shtml
//  http://www.greek-recipe.com/static/greek-cheese
//  http://www.park.org/Netherlands/pavilions/food_and_markets/cheese/introduction.html
//  http://www.dairyfarmers.org/engl/recipes/4_1.asp
//  http://www.prairieridgecheese.com/wischeesguid.html
//  http://dmoz.org/cgi-bin/add.cgi?where=Recreation/Food/Cheese
//  http://dmoz.org/about.html
//  http://dmoz.org/cgi-bin/apply.cgi?where=Recreation/Food/Cheese

//  Do it again, but this time with avoid patterns.
spider.Initialize("directory.google.com");
spider.AddUnspidered("http://directory.google.com/Top/Recreation/Food/Cheese/");

//  Add some avoid patterns:
spider.AddAvoidOutboundLinkPattern("*dmoz.org*");
spider.AddAvoidOutboundLinkPattern("*?id=*");
spider.AddAvoidOutboundLinkPattern("*.co.uk*");
success = spider.CrawlNext();

textBox1.Text += "-----------------------" + "\r\n";

//  Display the outbound links
for (i = 0; i <= spider.NumOutboundLinks - 1; i++) {
    textBox1.Text += spider.GetOutboundLink(i) + "\r\n";
}

//  Output:
//  http://www.cheese.com/
//  http://www.cheesediaries.com/
//  http://www.WisDairy.com/
//  http://www.newenglandcheese.com
//  http://www.ilovecheese.com
//  http://www.cheesefromspain.com
//  http://www.realcaliforniacheese.com/
//  http://www.cheesesociety.org/
//  http://www.specialcheese.com/queso.htm
//  http://www.franceway.com/cheese/intro.htm
//  http://www.foodsubs.com/Chesfirm.html
//  http://www.thecheeseweb.com/
//  http://www.vtcheese.com/
//  http://www.coldbacon.com/cheese.html
//  http://www.reluctantgourmet.com/cheese.htm
//  http://www.lancewood.co.za/
//  http://www.switzerlandcheese.ca
//  http://www.frenchcheese.dk/
//  http://www.dolcevita.com/cuisine/cheese/cheese.htm
//  http://cheeseisland.net/
//  http://www.cheestrings.ca/
//  http://hgic.clemson.edu/factsheets/HGIC3506.htm
//  http://taquitos.net/yum/gc.shtml
//  http://www.greek-recipe.com/static/greek-cheese
//  http://www.park.org/Netherlands/pavilions/food_and_markets/cheese/introduction.html
//  http://www.dairyfarmers.org/engl/recipes/4_1.asp
//  http://www.prairieridgecheese.com/wischeesguid.html

 

© 2000-2012 Chilkat Software, Inc. All Rights Reserved.

Email Component · XML Parser