开发者

Can't open log.txt file

开发者 https://www.devze.com 2023-04-04 13:59 出处:网络
I want to create log file. this is the code that i try to do using( IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication() )

I want to create log file. this is the code that i try to do

using( IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication() )
                {
                    using( IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream( @"C:/Log.txt", FileMode.OpenOrCreate, isoFile ) )
                    {
                        using( StreamWriter sw = new StreamWriter( isoStream ) )
                        {

                                    .
开发者_如何转开发                                    .                                        
                                    .
                        }
                    }
                }

But i get an exception in the line

using( IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream( @"C:\Log.txt", FileMode.OpenOrCreate, isoFile ) )

The exception : Operation not permitted on IsolatedStorageFileStream.

What can i do to solve this problem ?

Thanks for any help.


Don't include a full path or drive name in the ISO filename.

Isolated storage files are created using relative filenames as they are stored in a sub-folder not under your control.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号