Silverlight 4 OOB Update process when hosted in enterprise portal
Ok, here is the situation. I would like to deploy a silverlight application to an enterprise portal. Users will access the application by logging in to the portal and navigating to the page where it is hosted. That's the easy part.
This silverlig开发者_JS百科ht 4 application is designed to be run in Out of Browser mode (OOB). My question is, is it possible to have the Silverlight OOB update process retrieve updates from behind the enterprise portal's authentication?
When I call App.Current.CheckAndDownloadUpdateAsync();
, how do I supply credentials so that this HTTP request will succeed?
Any ideas? Is the update process extensible?
Thanks for your help.
With Silverlight 4 this should be a possible scenario
In both classes WebClient and WebRequest you can use Credentials..
private void DownloadAdditionalThings()
{
WebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.ClientHttp);
var client = new WebClient();
client.UseDefaultCredentials = false;
client.Credentials = new NetworkCredential("username", "password");
client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
client.DownloadStringAsync(new Uri("http://blog.gfader.com/"));
}
private void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
{
string result = e.Result;
}
精彩评论