代码如下...目的是达到可以用蓝牙,NFC共享图片的目的...
private async void ApplicationBarIconButton_Share_Click(object sender, EventArgs e)
{
ShareMediaTask sharePhoto = new ShareMediaTask();
IsolatedStorageFile File = IsolatedStorageFile.GetUserStoreForApplication();
if(!File.DirectoryExists("ImageTemp"))
{
File.CreateDirectory("ImageTemp");
}
String filePath = "ImageTemp\\" + imageUrl.Substring(imageUrl.LastIndexOf('/') + 1, imageUrl.Length - imageUrl.LastIndexOf('/') -1);
filePath = HttpUtility.UrlDecode(filePath);
IsolatedStorageFileStream stream = File.CreateFile(filePath);
imageStream.Position = 0;
await imageStream.CopyToAsync(stream);
stream.Close();
sharePhoto.FilePath = filePath;
sharePhoto.Show();
File.DeleteFile(filePath);
}