Process[] p = Process.GetProcesses();
foreach (Process pp in p)
- Nov 04 Sat 2017 16:53
C# 強制關閉其他執行中的EXE
- Nov 04 Sat 2017 16:52
C# 開啟網址
System.Diagnostics.Process.Start("http://www.shineingshare.com/");
----------------------------------------------------------------------------------------------------------------
- Nov 04 Sat 2017 16:51
C# 開啟EXE
System.Diagnostics.Process.Start("notepad.exe");
----------------------------------------------------------------------------------------------------------------
- Nov 04 Sat 2017 07:03
C# 寫入字串至TXT最後面
using (StreamWriter sw = File.AppendText(@TEST.TXT))
{
sw.WriteLine("XXX");
}
----------------------------------------------------------------------------------------------------------------
- Nov 04 Sat 2017 07:02
C# 讀取TXT檔案
using (StreamReader sr = File.OpenText(@TEST.TXT))
{
string s = "";
while ((s = sr.ReadLine()) != null)
{
Console.WriteLine(s);
}
}
- Nov 03 Fri 2017 20:46
C# 系統啟動日期和安裝日期
System.Management.ObjectQuery MyQuery=new ObjectQuery("SELECT * FROM Win32_OperatingSystem");
System.Management.ManagementScope MyScope=new ManagementScope();
- Nov 03 Fri 2017 20:45
C# 取得進程詳細資訊