Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/272.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 写入文件(?隔离存储wp7)_C#_Windows Phone 7 - Fatal编程技术网

C# 写入文件(?隔离存储wp7)

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"

这段代码用于将文本框的值写入文件,但即使使用exist文件,它也不会创建文件,它仍然是空的

 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没有创建,当我创建文件并写入时,它没有写入