Windowsphone载入独立存储代码出错
以下是C#代码usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Net;u...
以下是C#代码
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using Microsoft.Phone.Controls;using System.IO.IsolatedStorage;using System.IO;
public event EventHandler<LaunchingEventArgs> Launching{ IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
try { using (var isoFileStream = new IsolatedStorageFileStream("MyFolder\\myFile.txt", FileMode.Open, myStore)) { using (var isoFileReader = new StreamReader(isoFileStream)) { TextBlock1.Text = isoFileReader.ReadLine(); } }
} catch { TextBlock1.Text = ""; }}
已解决请不要在回答——————————————————————————----------------
新代码为private void Application_Launching(object sender, RoutedEventArgs e) 展开
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using Microsoft.Phone.Controls;using System.IO.IsolatedStorage;using System.IO;
public event EventHandler<LaunchingEventArgs> Launching{ IsolatedStorageFile myStore = IsolatedStorageFile.GetUserStoreForApplication();
try { using (var isoFileStream = new IsolatedStorageFileStream("MyFolder\\myFile.txt", FileMode.Open, myStore)) { using (var isoFileReader = new StreamReader(isoFileStream)) { TextBlock1.Text = isoFileReader.ReadLine(); } }
} catch { TextBlock1.Text = ""; }}
已解决请不要在回答——————————————————————————----------------
新代码为private void Application_Launching(object sender, RoutedEventArgs e) 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询