📄 ex-21-18
字号:
// Example 21-18: Reading from isolated storage
namespace Programming_CSharp
{
using System;
using System.IO;
using System.IO.IsolatedStorage;
public class Tester
{
public static void Main()
{
Tester app = new Tester();
app.Run();
}
private void Run()
{
// open the configuration file stream
IsolatedStorageFileStream configFile =
new IsolatedStorageFileStream
("Tester.cfg",FileMode.Open);
// create a standard stream reader
StreamReader reader =
new StreamReader(configFile);
// read through the file and display
string theEntry;
do
{
theEntry = reader.ReadLine();
Console.WriteLine(theEntry);
} while (theEntry != null);
reader.Close();
configFile.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -