无法使用WP7在文本文件中编写文本消息

时间:2013-03-01 16:38:15

标签: vb.net windows-phone-7 text-files isolatedstorage isolatedstoragefile

我无法在wp7应用程序的文本文件中编写文件,我该怎么办?

这是我的代码

 Dim isolatedStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication
 Dim isoStream As IsolatedStorageFileStream = New IsolatedStorageFileStream("TextFile1.txt", FileMode.Append, isolatedStorage)
 Dim streamwriter As StreamWriter = New StreamWriter(isoStream)

 streamwriter.WriteLine("sample")
 streamwriter.Close()

我也尝试将它放在Using语句中,但它现在仍然在文本文件中写入

Dim isolatedStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication
        Using isoStream As IsolatedStorageFileStream = New IsolatedStorageFileStream("/TextFile1.txt", FileMode.Append, isolatedStorage)

            Using streamwriter As StreamWriter = New StreamWriter(isoStream)
                streamwriter.WriteLine("PreMenu.xaml")

                streamwriter.Close()
            End Using
        End Using

没有错误,但它没有在textfile中写文本,我该怎么办?

0 个答案:

没有答案