我已經將文本文件存儲到獨立存儲中,我的文件以「asdasdasd,asdasdasd」的方式保存,我如何使用分隔符來溢出它們而不是像這樣檢索整個字符串:通過分隔符檢索值
//Get the Store we created earlier
IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
//use a StreamReader to open and read the file
StreamReader readFile = null;
try
{
readFile = new StreamReader(new IsolatedStorageFileStream("SaveFolder\\SavedFile.txt", FileMode.Open, store));
string fileText = readFile.ReadToEnd();
//The control txtRead will display the text entered in the file
textBlock2.Text = fileText;
readFile.Close();
}
catch
{
//For now, a simple catch to make sure they created it first
//we will modify this later
textBlock2.Text = "Need to create directory and the file first.";
}
我該如何使用strs數組? – NoobieNeedHelp
@NoobieNeedHelp,這取決於你想用它做什麼 –
示例放入一個文本框textBlock2.Text = fileText; readFile.Close(); – NoobieNeedHelp