您是否连线到异步方法调用的方法完成事件?看到这个
http://www.silverlightshow.net/items/Using-the-SaveFileDialog-in-Silverlight-3.aspx
您的回调方法里面,你可以实现逻辑写入文件 - 通过获取指针文件流,如下图所示打开对话框,然后第一。
try
{
byte[] fileBytes = //your bytes here
SaveFileDialog dialog=new SaveFileDialog();
//Show the dialog
bool? dialogResult = this.dialog.ShowDialog();
if (dialogResult!=true) return;
//Get the file stream
using (Stream fs = (Stream)this.dialog.OpenFile())
{
fs.Write(fileBytes, 0, fileBytes.Length);
fs.Close();
//File successfully saved
}
}
catch (Exception ex)
{
//inspect ex.Message
}
嗨amazedsaint,我不知道什么是错的。我评论,然后取消注释了一些代码,然后对话框显示出来了。 但是在那之后,我写了一些字节数组有点麻烦,但是你的回答是解决方案。非常感谢!! –