c# - WebClient not working when service run as LocalService Account -


i have windows service sends post request url:

            system.net.servicepointmanager.expect100continue = false;             using (webclient wc = new webclient())             {                 wc.headers[httprequestheader.contenttype] = "application/x-www-form-urlencoded";                 string htmlresult = wc.uploadstring(url, myparameters);                  console.writeline(htmlresult);             } 

this works if service run administrator , when run in console application. when run localservice account timeout.

what can this?

i guess problem localservice not allowed access remote resources. need use account allowed use remote resources network service or user account created specific rights fit needs (you might need access local folder read/write data) best practice imho.


Comments