no acces to .txt with Webmatrix ASP.NET -


i got tiny website company check in store brand can found. website uses c# code check .txt files in subfolder. worked nice while used path "c:\brands" on pc try host homepage changed path "~/app_data/brands/normal" + storenames()[i] + ".txt". can't access .txt files anymore. txt files located in root/app_data/brands/normal code in root/app_code. problem?

also i'm trying access files without special permissions or account. host https://panel.sitecloud.cytanium.com/.

what need access files again? problem code because doesn't work on localhost either (where worked extern folder)..

edit:

okay, mappath did job! forgot add mappath if(file.exists(httpcontext.current.server.mappath(sfilename)))..

try use httpcontext.current.server.mappath physical directory:

string data = file.readalltext(httpcontext.current.server.mappath("~/app_data/textfile.txt")); 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -