我已經在「汽車」文件中創建了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