platform/wp7/RhoRubyLib/common/RhoFile.cs in rhodes-3.3.2 vs platform/wp7/RhoRubyLib/common/RhoFile.cs in rhodes-3.3.3.beta.1
- old
+ new
@@ -296,9 +296,25 @@
}
return content;
}
+ public static String readFileToString(String path)
+ {
+ string content = "";
+ path = CFilePath.removeFirstSlash(path);
+
+ if (!isFileExist(path)) return content;
+
+ using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
+ using (Stream st = isoStore.OpenFile(path, FileMode.Open, FileAccess.Read, FileShare.None))
+ using (System.IO.BinaryReader br = new BinaryReader(st))
+ {
+ content = new String(br.ReadChars((int)st.Length));
+ }
+ return content;
+ }
+
public static String readStringFromResourceFile(String path)
{
string content = "";
path = CFilePath.removeFirstSlash(path);