Mi capita spesso di dover ripetere sto codice… ecco che me lo appunto:
SyndicationFeed feed;
WebProxy proxy = new System.Net.WebProxy("xx.xx.xx.xx", 8080);
proxy.BypassProxyOnLocal = true;
proxy.Credentials = new System.Net.NetworkCredential("nome", "pwd", "dominio");
using (WebClient client = new WebClient { Proxy = proxy })
{
using (Stream stream = client.OpenRead(rssUrl))
{
using (XmlReader xmlreader = XmlReader.Create(stream))
{
feed = SyndicationFeed.Load(xmlreader);
}
}
}