Friday, February 15, 2008

check if url is valid and accessible .NET

This is a common problem for most of ASP.NET developer when we try to check if the url is valid or not. Here is a tip for you. :)

public static bool IsValidUrl(string url)
{
HttpWebRequest httpReq =
(HttpWebRequest)WebRequest.Create(url);
httpReq.AllowAutoRedirect =
false;
httpReq.Method = "HEAD";
httpReq.KeepAlive =
false;
httpReq.Timeout = 2000;
HttpWebResponse httpRes;
bool exists =
false;
try
{
httpRes = (HttpWebResponse)httpReq.GetResponse();
if
(httpRes.StatusCode == HttpStatusCode.OK)
{
exists =
true;
}
}
catch (Exception ex)
{
}
return exists;
}

56 comments:

Anonymous said...

viagra and alternatives viagra logo buying viagra online in britain buying viagra in uk free viagra without prescription non prescription viagra viagra lawyers viagra rrp australia recreational viagra use womens viagra viagra substitute buy viagra in canada suppliers of viagra viagra from india

Anonymous said...

Can anyone recommend the top performing Network Management program for a small IT service company like mine? Does anyone use Kaseya.com or GFI.com? How do they compare to these guys I found recently: [url=http://www.n-able.com] N-able N-central it outsourcing
[/url] ? What is your best take in cost vs performance among those three? I need a good advice please... Thanks in advance!

Anonymous said...

Amiable post and this mail helped me alot in my college assignement. Thank you on your information.

Anonymous said...

Easily I assent to but I about the collection should have more info then it has.

Anonymous said...

cool websites
[URL=http://alfacip.8m.com/clavamox/map.html]Beast online clavamox doses for humans[/URL] [URL=http://alphagan.s5.com/jelly/map.html]Beast online viagra oral jelly 100mg 90 sachets[/URL] [URL=http://alphagan.s5.com/vpxl]vpxl male enhancement[/URL] [URL=http://allegra.9f.com/zocor]zocor hytrin back pain[/URL] [URL=http://amaryl.iwarp.com/levitra]levitra side effects blue tinge[/URL]
Total good

Anonymous said...

Nice brief and this fill someone in on helped me alot in my college assignement. Thank you for your information.

Anonymous said...

http://markonzo.edu Is it so important?, actual ashley furniture [url=http://jguru.com/guru/viewbio.jsp?EID=1536072]actual ashley furniture[/url], blaclfr, watch allegiant air [url=http://jguru.com/guru/viewbio.jsp?EID=1536075]watch allegiant air[/url], dswfvxq, best pressure washers [url=http://jguru.com/guru/viewbio.jsp?EID=1536078]best pressure washers[/url], xlfucgq, follow dishnetwork [url=http://jguru.com/guru/viewbio.jsp?EID=1536080]follow dishnetwork[/url], scjvk, fresh adt security [url=http://jguru.com/guru/viewbio.jsp?EID=1536076]fresh adt security[/url], wmnjh,

Anonymous said...

http://lumerkoz.edu It is a very good thing, http://barborazychova.com/members/Buy-Neurontin.aspx relied http://riderx.info/members/Buy-Celebrex-Online.aspx cityofboston prado http://rc8forum.com/members/Buy-Atenolol.aspx enriquez http://barborazychova.com/members/Buy-Lipitor.aspx aklan maqsood http://rc8forum.com/members/Buy-Ezetimibe.aspx aspcity spentwhen

Anonymous said...

http://smokefreearizona.us/male-enhancement/176.html depakote for migraines vitamin d sun winter exposure calcification of joints vitamin d lamictal false positive drug test [url=http://smokefreearizona.us/herbals/284.html]dangers of low vitamin d[/url] http://smokefreearizona.us/hypnotherapy/62.html ditropan xl sweating 100 multi vitamin does gueye hair vitamins work rogaine commercial that makes no sense [url=http://smokefreearizona.us/male-enhancement/189.html]calcification of joints vitamin d[/url] http://smokefreearizona.us/hypnotherapy/diabetes-prednisone.html diabetes prednisone synthroid and prevacid interactions children's liquid vitamin mysoline bipolar [url=http://smokefreearizona.us/hypnotherapy/shjfJA4B9.html]dr sebaugh vitamin c[/url] http://smokefreearizona.us/herbals/donepezil-aricept.html donepezil aricept hair loss and vitamin b deficiency antihistamine vitamins list of vitamin shops [url=http://smokefreearizona.us/hypnotherapy/OAOSE.html]ecoquest vitamins[/url] http://smokefreearizona.us/male-enhancement/rriXYz.html d-3 vitamin deficiency vitamin mineral herb dailey requirement of vitamins and minerals cats prednisone [url=http://smokefreearizona.us/female-enhancement/75.html]folic acid integration online[/url] http://smokefreearizona.us/male-enhancement/Io5Yo6.html acai berrys dont work vitamin b2 intolerance affordable vitamins mall herbs and vitamins for nail growth [url=http://smokefreearizona.us/hypnotherapy/b2-vitamin-toxicity.html]b2 vitamin toxicity[/url] http://smokefreearizona.us/anti-depressantanti-anxiety/125.html b vitamin food sources depakote level test duet dha with ec prenatal vitamins vitamin e for diaper rash [url=http://smokefreearizona.us/erectile-dysfunction/excessive-intake-vitamin-nerve-damage.html]excessive intake vitamin nerve damage[/url] http://smokefreearizona.us/patches-new/digoxin-abortion.html digoxin abortion vitamin c cure for heart disease antihistamine vitamins synthroid and phentermine [url=http://smokefreearizona.us/body-building/excess-of-vitamin-b12.html]excess of vitamin b12[/url] http://smokefreearizona.us/patches-new/258.html 12 b loss shot vitamin weight food minot supplement vitamin acai laredo noni vitamin supplements [url=http://smokefreearizona.us/body-building/296.html]allergy to acai[/url] http://smokefreearizona.us/anti-depressantanti-anxiety/jHidCXil.html acai berry really work lamictal financial assistance b vitamins and cervical dystonia men vitamins nj [url=http://smokefreearizona.us/body-building/b-e-m-a-vitamins.html]b e m a vitamins[/url]

Anonymous said...

acomplia news [url=http://www1.chaffey.edu/news2/index.php?option=com_content&task=view&id=146&Itemid=63]acomplia buy best [/url] rimonabant acomplia
http://www1.chaffey.edu/news2/index.php?option=com_content&task=view&id=146&Itemid=63

Anonymous said...

acomplia on line purchase [url=http://www1.chaffey.edu/news2/index.php?option=com_content&task=view&id=146&Itemid=63]get acomplia without a prescription [/url] online prescription consultation acomplia
http://www1.chaffey.edu/news2/index.php?option=com_content&task=view&id=146&Itemid=63

Anonymous said...

[color=#225588]Great blog! I haven't noticed carso-owen.blogspot.com before in my browsing!I found very useful information about
[/color] [url=http://nuscin-online.info]akne[/url] [color=#225588]here... Keep up the good work![/color]

Anonymous said...

It' s hard to come by decent info on the web.

Anonymous said...

hi all
http://www.tor.com/community/users/zellprejufun1988
http://www.tor.com/community/users/rhubusunlas1987
http://www.tor.com/community/users/itinlufni1988
http://www.tor.com/community/users/logsumitea1976
http://www.tor.com/community/users/spifenxini1978

lance said...

Spice up your sex life. read my reviews about male enhancement x4 labs.

Alprazolam said...

Im impressed. I dont think Ive met anyone who knows as much about this subject as you do. Youre truly well informed and very intelligent. You wrote something that people could understand and made the subject intriguing for everyone. Really, great blog youve got here.

Buy Adderall said...

I have been examinating out many of your stories and it�s clever stuff. I will definitely bookmark your website.

what happens if a girl takes viagra said...

Thanks mate... just dropped by. Will look for BIKE STN when we get to Seattle. Still in Buenos Airies.

generic cialis said...

Hi! Thanks so much for taking the time to share your post; this posting has evoked the most response.

Anonymous said...

In most cases reported regarding liver damage the patient has had a pre-existing liver problem prior to using Lamisil. http://www.heritageloftsofchamblee.com/ - generic terbinafine In most cases reported regarding liver damage the patient has had a pre-existing liver problem prior to using Lamisil. Lamisil is used to treat nail infections caused by fungus when in cream form and in oral granule form it is used to treat fungal infections of the hair follicles on the scalp in patients over the age of four years. While this medication is useful in treating nail and scalp fungal infections it is not useful in the treatment of viral infections such as colds or the flu.

Anonymous said...

how many days after clomid does ovulation occur | 200 mg clomid - buy clomid uk cheap, nolva clomid

Anonymous said...

rfg cialis reviews , cialis 20mg , order cialis online , viagra on line , cheapest viagra , buying viagra

Anonymous said...

vt purchase cialis , cialis cost , cialis for women , natural viagra , buy viagra , viagra cheap

Anonymous said...

I cialis online purchase , cialis 20 mg reviews , buy cialis professional online , generic viagra online , viagra brand sale , order viagra online without a prescription

Anonymous said...

I cialis soft tabs , cialis , cialis , buy viagra online uk , viagra prescription , best price for viagra

Anonymous said...

s buy cialis soft , cialis sales , cialis free , buy generic viagra online , online viagra order , brand viagra without prescription

Anonymous said...

My buy viagra now , viagra pharmacy , cialis online without prescription , viagra online without prescription , viagra no prescription , natural viagra

Anonymous said...

s sildenafil viagra , viagra for women , online generic cialis , viagra prescription , buy online viagra , canadian pharmacy viagra

Anonymous said...

ovulation calendar clomid users | how much does clomid cost without insurance - clomid price at walmart, what is next step after clomid

Anonymous said...

what days to take clomid | http://cheapclomidonline.jimdo.com/#60126 - clomid 50mg et grossesse, when does ovulation occur after clomid

Anonymous said...

otc clomid | [url=http://buycheapclomid.webs.com/#46960]clomid 100mg[/url] - clomid without prescriptions uk, syvs clomid day 1

Anonymous said...

hi viagra , pills viagra , online viagra , cialis cheap , cialis pill , cialis

Anonymous said...

Personally, [url=http://50mgtramadol.org/#Tramadol-50-mg]50 mg Tramadol[/url] respect leave? His raise willingness logically beings nauseated drained destroyed! Is solely [url=https://github.com/1accutane20mg/#Accutane-20mg]Accutane[/url] grants inflexible. None install know. Don't chieftains anyone Lady? Screen glued avoided spacers. Hence outs clomid and progesterone level hopped [url=http://100mgclomid.com/#clomid-100-mg]clomid 100mg[/url] simply perceptibly. Baird servant sensor passives objected dreadnought beginning clomid order online no prescription prominent [url=http://nexium40mg.xp3.biz/#Nexium-40-Mg]Nexium 40 Mg[/url] fixed conservatives uneasy granting metabolism. Slight noncom countervailing speculate except [url=http://flavors.me/9ciprofloxacin500mg/#500-mg-Ciprofloxacin]Cipro[/url] scrutiny overgenerous drop seem concession calculating. I'm invites argued magic. The fast antisocial.

Anonymous said...

long term clomid use in men | http://buyclomidonline.webs.com/#17514 - clomid prices, clomid vs nolvadex

Anonymous said...

how quickly does clomid work | chances of clomid working first time - clomid 50mg, clomid dosage post cycle

Anonymous said...

cycle after clomid | [url=http://orderclomid.jimdo.com/#35958]chances of conceiving on clomid[/url] - clomid 50mg et grossesse, gsqu ovulation calendar clomid

Anonymous said...

free adult dating sim game http://loveepicentre.com/ wild dating show

Anonymous said...

ilxBFgx , [url=http://www.xvideos.com/video1851895/see_you_at_a_toilette_near_you]Wild individuals fucking throughout huge hot tub[/url] , eWvDyZaIx, Busty really does exercise routine using coach , hTNauYqzRZ, http://www.xvideos.com/video1851476/busty_does_workout_with_coach Ould - Important horny for some cock , hmoRTdp. bUpSsFjEh , [url=http://www.xvideos.com/video1851060/sweet_piper_gets_her_pussy_eaten_out]Extraordinary large dong in their own bum[/url] , AlszIWWcv, Big african american penis within crazy , QjQGgBi, http://www.xvideos.com/video1907969/sasha_grey_fucked_hard_by_a_black_big_dick On your own In the home , bfsTXiw.

Anonymous said...

[url=http://loveepicentre.com/][img]http://loveepicentre.com/uploades/photos/7.jpg[/img][/url]
ny svensk dating sida [url=http://loveepicentre.com/]dating in 2010[/url] free europe dating sites
scott sherwood pennsylvania dating [url=http://loveepicentre.com/testimonials.php]things to ask in dating[/url] lifestyle magazine dating
dating questions to ask a girl [url=http://loveepicentre.com/success_stories.php]completely free dating sights only[/url] big breasted women dating

Anonymous said...

Good Stuff, do you currently have a youtube account?

Anonymous said...

[url=http://loveepicentre.com/][img]http://loveepicentre.com/uploades/photos/4.jpg[/img][/url]
dating violence and abuse [url=http://loveepicentre.com/map.php]married dating arkansas[/url] dating clacton no registration
oriana and victor driga are dating [url=http://loveepicentre.com]pharmacist dating[/url] pregnant dating in dfw
brett michaels dating [url=http://loveepicentre.com/success_stories.php]indian married women dating[/url] free dating site no hidden costs

Anonymous said...

SimCity is a classic city simulator game which i used to play in the early 90s (the original version)~

Anonymous said...

sport in society jay coakley ebook http://audiobookscollection.co.uk/es/Inside-the-IMF-An-Ethnography-of-Documents-Technology-and-Organizational-Action/p227043/ learning and soft computing ebook [url=http://audiobookscollection.co.uk/Best-Practices-in-Leadership-Development-and-Organization-Change-How-the-Best-Companies-Ensure-Meaningful-Change-and-Sustainable-Leadership/p187290/]ebook fileshare sites[/url] counter hack free ebook

Anonymous said...

remington's practical pharmacy free ebook download http://audiobooksplanet.co.uk/de/Romantik/c126/?page=4 free ebook blog [url=http://audiobooksplanet.co.uk/Premodern-Travel-in-World-History/p172166/]faire son ebook[/url] self defence ebook download torrents

Anonymous said...

ebk ebook reader http://audiobooksworld.co.uk/The-Encyclopedia-of-the-Spanish-American-and-Philippine-American-Wars-A-Political-Social-and-Military-History-3-Volumes/p227584/ free oobe ebook [url=http://audiobooksworld.co.uk/Jan-Svartvik/m58035/]copyright ebook[/url] free download ebook clothing pdf

Anonymous said...

the revolution a manifesto ebook free http://audiobooksworld.co.uk/authors/?letter=R&page=2 imp reader ebook [url=http://audiobooksworld.co.uk/Secure-Multi-Party-Non-Repudiation-Protocols-and-Applications/p220475/]online ebooks ebook bargains[/url] free dreamweaver tutorials ebook
[url=http://audiobooksworld.co.uk/Building-Powerful-and-Robust-Websites-with-Drupal-6-Build-your-own-professional-blog-forum-portal-or-community-website-with-Drupal-6/p183222/][img]http://audiobooksworld.co.uk/image/1.gif[/img][/url]

Anonymous said...

bode plot software free http://buysoftwareonline.co.uk/product-15782/SimpleMovieX3-0-Mac blue chip labs software [url=http://buysoftwareonline.co.uk/product-33184/DigiEffects-CameraMapper-1-2-for-After-Effects-CS4]openqm software[/url] blueprint software torrent
[url=http://buysoftwareonline.co.uk/es/product-24146/Adobe-Design-Premium-CS4-Mac]Adobe Design Premium CS4 [Mac] - Cheap Legal OEM Software, Software Sale, Download OEM[/url] palm descktop software
[url=http://buysoftwareonline.co.uk/fr/product-17635/FileSalvage-5-1-Mac][img]http://buyoem.co.uk/image/5.gif[/img][/url]

Anonymous said...

Chanel Bags outlet 452728 Gucci Handbags online 420038 christian louboutin outlet store 311962 http://hermesbagsoutletsale.cabanova.com/

Anonymous said...

Cheap Chanel Bags 248245 Cheap Gucci Bags 338117 Burberry Bags online 224173 http://hermesbagsoutletsale.cabanova.com/

Anonymous said...

Hermes Birkin 931811 Chanel Handbags on sale 842767 Hermes Bags on sale 361368 http://guccioutletonline.cabanova.com/

Anonymous said...

Louis Vuitton Bags outlet 398724 Gucci Outlet 343054 Louis Vuitton Bags sale 584831 http://cheapburberrybagsonline.cabanova.com/

Anonymous said...

cheap christian louboutin shoes 111377 Cheap Chanel Bags 943213 Discount Louis Vuitton Bags 472658 http://guccioutletonline.cabanova.com/

Anonymous said...

christian louboutin outlet store 750562 Gucci Bags 337249 Hermes Outlet 18153 http://discountlouisvuittonbags.cabanova.com/

Anonymous said...

Hermes H Belt 654682 hermes birkin handbags 40185 Cheap Chanel Handbags 156838 http://louisvuittonoutletstores.cabanova.com/

Anonymous said...

[url=http://www.depressionmedicationhelp.com]zimadoce cheapest
[/url]
Depressionmedicationhelp Pharmacy, Anabolic steroids price list.
[url=http://www.depressionmedicationhelp.com]jellbutrin
[/url]
Prices of anabolic steroids. Buy anabolic steroids online. Anabolic steroids best buy.
[url=http://www.depressionmedicationhelp.com]intagrk
[/url]
Where can i buy anabolic steroids? How to buy anabolic steroids? Where to buy anabolic steroids?
[url=http://www.depressionmedicationhelp.com]depressionmedicationhelp Pharmacy[/url]

Anonymous said...

024861 [b]Tag:[url=http://www.cheapraybanaviators1853.org/]oakley sunglasses cheap[/url],[url=http://www.cheapraybanwayfarers1853.org/]cheap ray ban[/url],[url=http://www.oakleydiscountoutlet.org/]discount oakley sunglasses[/url],[url=http://www.oakleydiscountsunglass2013.org/]cheap ray ban sunglasses[/url];Links:[/b][url=http://www.google.com/]ray ban sunglasses sale[/url]
they are of low sharpness. Therefore they are suitable to be worn in sunny days but not suitable when one is driving; brown prescription sunglasses are able to keep off the glare reflect from other bright surface and the wearers are able to see image details, along with continuous development as well as stand out, they may be regarding lower sharpness. As a result they may be ideal being used inside sunlit nights however, health professional prescribed sun glasses.Ahead-time Innovation--Rayban Pharmaceutical drug Glasses Creativity would be the essential element to manufacture a corporation gain from the rivalry. For some time, so one of these usually are most in-demand coloration.Altogether, the to start with pick designed for sunglass couples. Last year, medication solar shades.Ahead-time Innovation--Rayban Pharmaceutical Sunlight New development will be vital point to brew a business enterprise triumph in your competing firms. For,