- private void WriteFile(string strPath,string strWrite)
- {
- FileStream fs = new FileStream(strPath, FileMode.Create, FileAccess.Write);
- StreamWriter sw = new StreamWriter(fs);
- sw.WriteLine(strWrite);
- sw.Close();
- }
- private string ReadFile(string strPath)
- {
- string strRead = string.Empty;
- FileStream fs = new FileStream(strPath, FileMode.Open, FileAccess.Read);
- StreamReader sr = new StreamReader(fs);
- if (sr.Peek() != -1)
- {
- strRead = sr.ReadLine();
- }
- sr.Close();
- return strRead;
- }