C# 代码
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
var systemRoot = System.Environment.SystemDirectory; Process.Start(systemRoot[0].ToString() + @":\Program Files\Common Files\microsoft shared\ink\TabTip.exe");
读取文本文件并范围listarray类型
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 private ArrayList ReadTxt() 2 { 3 string path = Application.StartupPath; 4 string pathtxt = System.IO.Path.Combine(path, "Elevation.txt"); 5 StreamReader sr = new StreamReader(pathtxt); 6 string line; 7 ArrayList linearr = new ArrayList(); 8 while ((line = sr.ReadLine()) != null) 9 { 10 linearr.Add(line); 11 12 } 13 return linearr; 14 }
读取文本文件的另一种方法
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
获取系统信息
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 private string GetSystemInfo() 2 { 3 string info = string.Empty; 4 info+= SystemInformation.UserName+Environment.NewLine; 5 info += SystemInformation.ComputerName + Environment.NewLine; 6 info += System.Environment.OSVersion.Platform.ToString() + Environment.NewLine; 7 info += System.Environment.OSVersion.ServicePack + Environment.NewLine; 8 info += System.Environment.OSVersion.ToString() + Environment.NewLine; 9 return info; 10 }
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
public void WriteLog(string LogContent) { using (StreamWriter sw = new StreamWriter("c:\\Log.txt", true)) { sw.WriteLine(LogContent); sw.Close(); } }