C# 写入文件(?隔离存储wp7)
这段代码用于将文本框的值写入文件,但即使使用exist文件,它也不会创建文件,它仍然是空的C# 写入文件(?隔离存储wp7),c#,windows-phone-7,C#,Windows Phone 7,这段代码用于将文本框的值写入文件,但即使使用exist文件,它也不会创建文件,它仍然是空的 private void button1_Click(object sender, RoutedEventArgs e) { string url =infooo.ur + txtb1.Text + "/" + passtxx.Password + "/1/570322308ce1121cba1b93f5acc9ebd4733ef2bca90ef942a2cfa224f0aa08dc/1"
private void button1_Click(object sender, RoutedEventArgs e)
{
string url =infooo.ur + txtb1.Text + "/" + passtxx.Password + "/1/570322308ce1121cba1b93f5acc9ebd4733ef2bca90ef942a2cfa224f0aa08dc/1";
client.DownloadStringAsync(new Uri(url));
IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream stream = iso.CreateFile("T11.txt");
StreamWriter streamWrite = new StreamWriter(stream);
streamWrite.Write(txtb1.Text);
streamWrite.Close();
}
要确保文件未保存,请尝试列出隔离存储:
此代码中没有例外:(如果您在streamWrite.Write(txtb1.Text);行上中断-文本框有值吗?是的,txtbox上有值,但它没有保存。您如何知道文件没有保存?没有保存在解决方案中,或者D没有创建,当我创建文件并写入时,它没有写入