Ejemplo n.º 1
0
 /// <summary>
 /// 写入
 /// </summary>
 /// <param name="path"></param>
 public void WriteToFile(string path)
 {
     using (var writer = new PeriodPrnWriter(path))
     {
         foreach (var item in this)
         {
             writer.Write(item);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 返回文本
 /// </summary>
 public string GetText()
 {
     using (MemoryStream stream = new MemoryStream())
     {
         var writer = new PeriodPrnWriter(stream);
         foreach (var item in this)
         {
             writer.Write(item);
         }
         writer.Flush();
         stream.Position = 0;
         StreamReader reader = new StreamReader(stream);
         return(reader.ReadToEnd());
     }
 }