コード例 #1
0
ファイル: ScreenShot.cs プロジェクト: geeksree/cSharpGeeks
        private void SaveStepMessage(StepMessage message)
        {
            //XmlSerializer ser = new XmlSerializer(typeof(StepMessage));
            //bool bAppend = true ;
            
            //TextWriter writer = new StreamWriter(string.Format(@"{0}\message.xml",LogFolder), bAppend);

            //ser.Serialize(writer, message);

            //writer.Close();   
            //string sb = string.Format("{1}", message.Message);
            if (!File.Exists(string.Format(@"{0}\message.csv", LogFolder)))
            {
                StreamWriter w = File.CreateText(string.Format(@"{0}\message.csv", LogFolder));
                w.WriteLine(message.Message);
                w.Close();
            }
            else
            {
                StreamWriter w = File.AppendText(string.Format(@"{0}\message.csv", LogFolder));
                w.WriteLine(message.Message);
                w.Close();
            }            
        }
コード例 #2
0
ファイル: ScreenShot.cs プロジェクト: geeksree/cSharpGeeks
 private StepMessage GetStepMessage(string messagetext)
 {
     StepMessage message = new StepMessage();
     message.StepNumber = 1;
     message.StepName = string.Format("Step:{0}", message.StepNumber);
     message.Message = messagetext;
     return message;
 }