我已经在“汽车”文件中创建了IO 中的一些文件,我想把一些其他参考如模型,颜色等...... 所以我的问题是:是有可能有在IO 多衬里的文件,如果是我怎样才能在StreamReader的 让他们//我想在一个文件中存储的许多参数,并通过StreamReaderIsolatedStorage @Windows Phone 7
保护覆盖无效找回来OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) {
//reception des parametres de la listbox
base.OnNavigatedTo(e);
string parameter = this.NavigationContext.QueryString["parameter"];
this.tbTitre.Text = parameter;
try
{
//Create a new StreamReader
StreamReader editionDevisReader = null;
IsolatedStorageFile probyOrange = IsolatedStorageFile.GetUserStoreForApplication();
//Read the file from the specified location.
editionDevisReader = new StreamReader(new IsolatedStorageFileStream("devis\\"+parameter+".txt", FileMode.Open, probyOrange));
//Read the contents of the file .
string textFile = editionDevisReader.ReadLine();
//Write the contents of the file to the TextBlock on the page.
tbTitre.Text = textFile;
while (editionDevisReader != null)
{
RowDefinition rowdefinition = new RowDefinition();
TextBlock textblock = new TextBlock();
textblock.HorizontalAlignment = new System.Drawing.Size(48, 20);
}
editionDevisReader.Close();
}
catch
{
//If the file hasn't been created yet.
tbTitre.Text = "veuillez d abord creer le fichier";
}
THX很多都
我明白了,我想知道如何在streamreader中读取它们。如果我创建一个文件“car.txt”,我想在文件中加入颜色,模型等......所以我怎么读它们? thx很多为你的帮助 – user569574 2011-01-12 13:53:38
@ user569574我已经添加了一个阅读文件的例子 – 2011-01-13 09:15:05