Beispiel #1
0
        public static void Log(Formula formula)
        {
            string text = DateTime.Now.ToString() + " Got formula: ";

            text += formula.StringInfo() + Environment.NewLine;
            FileWorker.AppendToFile(text, "Log.txt");
        }
Beispiel #2
0
        public static void Log(string text)
        {
            string timeStamp = DateTime.Now.ToString();

            text = timeStamp + " " + text + Environment.NewLine;
            FileWorker.AppendToFile(text, "Log.txt");
        }
Beispiel #3
0
        private void BtnStart_Click(object sender, EventArgs e)
        {
            string fileName = "Results.txt";
            var    api      = new APIWolframAlfa();
            string toWrite  = "";

            foreach (var formula in formulas)
            {
                toWrite += formula.m_toFind + " = " + api.Solve(formula) + "[" + formula.m_units + "]" + Environment.NewLine;
            }
            MessageBox.Show(toWrite, "Results");
            if (checkBoxAppend.Checked)
            {
                FileWorker.AppendToFile(toWrite, fileName);
            }
            else
            {
                FileWorker.WriteToFile(toWrite, fileName);
            }
        }