$url = "http://www.example.com/test.html"
$webClient = new-object System.Net.WebClient
$output = $webClient.DownloadString($url)
I see that System.Net.WebClient has a CachePolicy property, but I
don't really know how to implement it in this example. Any ideas?
[System.Reflection.Assembly]::LoadWithPartialName("System.Net.Cache")
$policy = new-object System.Net.Cache.RequestCachePolicy("BypassCache")
and then you can set the CachePolicy property to the $policy object.
-Paul
$url = "http://www.weatheroffice.com/scripts/nphshowarf.pl?
html&1010.txt"
[System.Reflection.Assembly]::LoadWithPartialName("System.Net.Cache")
$policy = new-object
System.Net.Cache.RequestCachePolicy("BypassCache")
$webClient = new-object System.Net.WebClient
$webclient.CachePolicy.($policy)
$output = $webClient.DownloadString($url)
$webClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE
5.5; Windows NT 5.0)")
On Oct 7, 5:59 pm, PaulChavez <PaulCha...@discussions.microsoft.com>
wrote:
> > don't really know how to implement it in this example. Any ideas?- Hide quoted text -
>
> - Show quoted text -
You may want to experiment with these cache levels a bit.
Paul