c# - WebClient().DownloadString() returning old data -


this question has answer here:

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); 

msdn documentation on webclient cache


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -