深入探索Silverlight的独立存储与文件操作
在Silverlight开发中,独立存储、文件对话框以及与Web服务的文件传输是非常重要的功能。下面将详细介绍这些功能的使用方法和相关代码。
独立存储操作
在处理人员文件列表时,有几个关键操作。当更新列表时,代码如下:
' Update the list.
lstPeople.ItemsSource = store.GetFileNames("*.person")
End Using
End Sub
当用户点击列表中的人员文件时,会从独立存储中检索数据:
Private Sub lstPeople_SelectionChanged(ByVal sender As Object, _
ByVal e As SelectionChangedEventArgs)
If lstPeople.SelectedItem Is Nothing Then Return
Using store As IsolatedStorageFile = _
IsolatedStorageFile.GetUserStoreForApplication()
Using stream As FileStream = _
store.OpenFile(lstPeople.SelectedItem.ToString(), FileMode.Open)
Dim person As Person = CType(
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



