C# 動態修改表單(Winform)標題(Text)[讀取文字檔]
private void change_Title()//任意更換標題
{
if (System.IO.File.Exists(“Title.txt”))
{
//有
StreamReader sr = new StreamReader(“Title.txt”);
while (!sr.EndOfStream)// 每次讀取一行,直到檔尾
{
string line = sr.ReadLine();// 讀取文字到 line 變數
this.Text = line;
break;
}
sr.Close();
}
}