📄 csettings.cs
字号:
using System;
using System.IO;
namespace SmartWKN
{
/// <summary>
/// Save and Read the Settings
/// </summary>
public class cSettings
{
public cSettings()
{
}
private string mYahooURL = string.Empty;
private string mGraphURL = string.Empty;
private string mTickerSymbol = string.Empty;
public string YahooURL
{
get { return mYahooURL; }
set { mYahooURL = value; }
}
public string GraphURL
{
get {return mGraphURL; }
set { mGraphURL = value; }
}
public string TickerSymbol
{
get {return mTickerSymbol; }
set { mTickerSymbol = value; }
}
public bool LoadData(string Path)
{
bool RetValue = false;
try
{
StreamReader reader = new StreamReader(Path, System.Text.Encoding.Default);
mYahooURL = reader.ReadLine();
mGraphURL = reader.ReadLine();
mTickerSymbol = reader.ReadLine();
reader.Close();
RetValue = true;
}
catch
{
RetValue = false;
}
return RetValue;
}
public bool SaveData(string Path)
{
bool RetValue = false;
try
{
StreamWriter writer = new StreamWriter(Path, false, System.Text.Encoding.Default);
writer.WriteLine(mYahooURL);
writer.WriteLine(mGraphURL);
writer.WriteLine(mTickerSymbol);
writer.Close();
RetValue = true;
}
catch
{
RetValue = false;
}
return RetValue;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -