请问,我有一个twitter 应用,是用Silverlight实现的,需要用webclient 调用twitter API,写法是这样的
string MENTIONS_TIMELINE = "http://twitter.com/statuses/mentions.rss";
WebRequest.RegisterPrefix("http://", System.Net.Browser.WebRequestCreator.ClientHttp);
WebClient twitter = new WebClient();
twitter.Credentials = new NetworkCredential(UserName.Text, Password.Password);
twitter.UseDefaultCredentials = false; // must be set to false if providing your own credentials
twitter.DownloadStringCompleted += new DownloadStringCompletedEventHandler(TwitterResultCompleted);
twitter.DownloadStringAsync(new Uri(MENTIONS_TIMELINE));
这样,如果该应用设置成"允许在浏览器外运行应用程序",上面的代码没有问题,能够正常访问twitter API,但如果不设置该选项,在浏览器里面运行,则不能访问twitter API,报"安全性错误",请高手解答,多谢