Пример #1
0
        //static object oo = new object();
        public static void write_state(string s, object d)
        {
            try
            {
                string msg = "";
                if (d is double)
                {
                    int d1 = (int)((double)d * 100);
                    int d2 = (int)(
                        (int)((double)d * 10000) - (int)((double)d * 100) * 100
                        );

                    msg = d1.ToString();
                }
                else
                {
                    msg = d.ToString();
                }

                using (StreamWriter sw = new StreamWriter(s + "state.log", false))
                {
                    sw.WriteLine(msg);
                    sw.Close();
                }

                CYZLog.writeLog2("downPro  " + msg, "", s);
            }
            catch (Exception ex) { }
            finally
            { }
        }