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

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -

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

javascript - Restarting Supervisor and effect on FlaskSocketIO -