[Mono-bugs] [Bug 81849][Cri] Changed - IsolatedStorage not working properly.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sun Jun 10 16:20:33 EDT 2007
Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.
Changed by robertj at gmx.net.
http://bugzilla.ximian.com/show_bug.cgi?id=81849
--- shadow/81849 2007-06-10 15:50:39.000000000 -0400
+++ shadow/81849.tmp.27763 2007-06-10 16:20:33.000000000 -0400
@@ -79,6 +79,63 @@
dependencies) instead of a cook receipt.
------- Additional Comments From xcap2000 at gmail.com 2007-06-10 15:50 -------
I did not understand exactly what you want, could you be more specific
as I do not live in an English speaking country!
+
+------- Additional Comments From robertj at gmx.net 2007-06-10 16:20 -------
+That's why it's better to post a small compilable test case
+which reproduces the problem, instead of just talking about it :-)
+
+The test I have attached is first reading from an ISO
+store, then it's writing a stamp (current daytime),
+then it's reading this stamp again.
+
+When you call this sample multiple times, you'll see that it's
+working correctly.
+
+Please try to change this sample to reproduce your problem.
+
+
+using System;
+using System.IO;
+using System.IO.IsolatedStorage;
+
+class Test
+{
+ static void Main ()
+ {
+ Console.WriteLine ("old value was: {0}", Read ());
+ Write (DateTime.Now.ToString ());
+ Console.WriteLine ("new value is: {0}", Read ());
+ }
+
+ static void Write (string line)
+ {
+ IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForDomain ();
+ Stream stm = new IsolatedStorageFileStream ("test.txt",
+FileMode.OpenOrCreate, isf);
+ TextWriter tw = new StreamWriter (stm);
+ tw.WriteLine (line);
+ tw.Close ();
+ stm.Close ();
+ isf.Close ();
+
+ }
+
+ static string Read ()
+ {
+ IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForDomain ();
+ Stream stm = new IsolatedStorageFileStream
+("test.txt", FileMode.OpenOrCreate, isf);
+ TextReader r = new StreamReader (stm);
+ string res = r.ReadToEnd ();
+ r.Close ();
+ stm.Close ();
+ isf.Close ();
+ return res;
+ }
+
+}
+
+
More information about the mono-bugs
mailing list