在我的Windows Phone 7的网络浏览器应用程序中,我只能看到图像,但我想从网页下载图像(使用上下文菜单)并将其保存到媒体库。我的网络浏览器控件名为 browsers 。谁能帮我?在此先感谢您的帮助? 以下代码中存在错误 - 在“uri”和“e”。
private void MenuItem_Click(object sender, RoutedEventArgs e)
{
HttpWebRequest WebRequest = HttpWebRequest.CreateHttp(uri);>>>Error in "uri"
WebRequest.BeginGetResponse((asyncCallback) =>
{
try
{
MediaLibrary library = new MediaLibrary();
library.SavePicture(imageName, WebRequest.EndGetResponse(asyncCallback).GetResponseStream());
}
catch (Exception e)>>>>>Error in "e"
{}
}, WebRequest);
}
public string imageName { get; set; }
答案 0 :(得分:0)
在浏览器控件中选中并按住图像...是否有用于保存图像的上下文菜单?
答案 1 :(得分:0)
HttpWebRequest WebRequest = HttpWebRequest.CreateHttp(uri);
WebRequest.BeginGetResponse((asyncCallback) =>
{
try
{
MediaLibrary library = new MediaLibrary();
library.SavePicture(imageName, WebRequest.EndGetResponse(asyncCallback).GetResponseStream());
}
catch (Exception e) { }
}, WebRequest);