开发者

Can't open log.txt file

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜