c# - WebClient().DownloadString() returning old data -
this question has answer here:
- c# webclient disable cache 12 answers
i using code return string url
webclient.encoding = encoding.utf8; response = webclient.downloadstring("http://somesite.com/code.php"); console.write(response);
the code.php
looks this
<?php $data = file_get_contents('code.txt'); echo $data; ?>
the problem when change contents of code.txt
file, webclient.downloadstring()
method returns old contents of code.txt
file. when open url http://somesite.com/code.php
in browser works fine.
any solutions appreciated!
my question seems duplicated don't understand said here: c# webclient disable cache
if explain , provide example code great!
try disabling cache on webclient
webclient.cachepolicy = new system.net.cache.requestcachepolicy(system.net.cache.requestcachelevel.nocachenostore);
Comments
Post a Comment