c# - Operation not permitted on IsolatedStorageFileStream. IsolatedStorage Exception -
I'm starting for C # and Visual Studio to get the custom parameters in the player to play videos from within the browser Has created a Silverlight application.
The code for running the application outside the browser is given below:
// When running outside of the browser, retrieve initParams from separate storage. If using (Application.Current.IsRunningOutOfBrowser) {(IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication ()) (using stream = new IsolatedStorageFileStream ("initParams.txt", System.IO.FileMode.Open, System.IO FileAccess.Read, File)) // Serializer needs a reference to the system. time to time. Serialization.dll Data Contracerecerizeriser serializer = New Data Contrast Cyberizer (typef (dictionary; string, string & gt;)); InitParams = (dictionary & lt; string, string & gt;) serializer.ReadObject (stream); }} // Otherwise, save initParam for separate storage. Other {initParams = E. Antwerp; (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication ()) (IsolatedStorageFileStream Stream = New IsolatedStorageFileStream ("initParams.txt", System.IO.FileMode.Create, File)) {DataContractSerializer serializer = New DataContractSerializer (Typical (& lt; String, string & gt;)); serial. WrititeObject (stream, initParams); }}
and I get the error, using the code
(IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForApplication ()) using the operation In IsolatedStorage exceptions (in the current stream = new IsolatedStorageFileStream ("initParams.txt", System.IO.FileMode.Open, System.OO.FileAccess.Read, File))
in Visual Studio Error message is
System.IO.IsolatedStorage.IsolatedStorageException: Not allowed on operation IsolatedStorageFileStream. System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor (string path, FileMode mode, FileAccess access, fileshare share, Int32 bufferSize, IsolatedStorageFile ISF) on System.IO.IsolatedStorage.IsolatedStorageFileStream..ctor (String Path, FileMode Mode, FileAccess Access On the testplayer.App.LoadInitParams (IsolatedStorageFileEf) on testplayer.App.Application_Startup (Object Sender, StartupEventArgs e) on MS.Internal.CoreInvokeHandler.InvokeEventHandler (UInt32 type index, delegate handler, object sender, object args ) Internal.JoltHelper.FireEvent (IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, Int32 actualArgsTypeIndex, string turning on MS Name, UInt32 flags)
If anyone can help me to solve this problem?
Thanks in advance
Comments
Post a Comment