我想知道是否有任何解决方法.我已经有了字节数组,现在我需要将它保存到用户指定的位置.不管怎样…
任何线索?
提前致谢.
解决方法 您是否连接到异步方法调用的方法已完成事件?看到这个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,fileBytes.Length ); fs.Close(); //file successfully saved } } catch ( Exception ex ) { //inspect ex.Message }总结
以上是内存溢出为你收集整理的wcf – 如何将字节数组从silverlight保存到文件中全部内容,希望文章能够帮你解决wcf – 如何将字节数组从silverlight保存到文件中所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)