i would like when i create a file in the IO by using the StreamWriter something like
streamReaderLOL = new StreamReader(
new IsolatedStorageFileStream("test\\parameter.txt", FileMode.Open, UserPlace));
where parameter is a variab开发者_开发问答le i have try smth like
"test\\"+parameter".txt" etc but seems not to work.
so my question is : is it possible ?
ty a lot
Using "test\\" + parameter + ".txt"
should be absolutely fine. It's only constructing a string to pass in as the arugment, after all.
If you want to use a directory within IsolatedStorage you must first create the directory before trying to use it.
using (var isoStore = IsolatedStorageFile.GetUserStoreForApplication())
{
if (!isoStore.DirectoryExists("test"))
{
isoStore.CreateDirectory("test");
}
isoStore.CreateFile("test\\" + param + ".txt");
}
精彩评论