コード例 #1
0
ファイル: Setting.cs プロジェクト: atarael/MonitorSoftware
        public string readSettingFromDB()
        {
            //string userName = Environment.UserName;

            //String projectDirectory = Environment.CurrentDirectory;
            //string filepath = Directory.GetParent(projectDirectory).Parent.FullName;
            //String[] paths = new string[] { @filepath, "files" };
            //filepath = Path.Combine(paths);
            //string setting = "";
            //DirectoryInfo d = new DirectoryInfo(filepath);//Assuming Test is your Folder
            ////ShowErrorDialog("filepath is: \n" + filepath);
            //if (!Directory.Exists(filepath))
            //{
            //    return "";
            //}

            //using (StreamReader sr = System.IO.File.OpenText(Path.Combine(filepath, "setting_" + userName + ".txt")))
            //{
            //    sr.ReadLine();
            //    sr.ReadLine();

            //    //ShowErrorDialog("id\n" + id);
            //    string line = "";
            //    while ((line = sr.ReadLine()) != null)
            //    {
            //        //ShowErrorDialog("line\n" + line);
            //        setting += line + "\r\n";
            //    }
            //}

            DBclient DBInstance = DBclient.Instance;
            string   setting    = DBInstance.getGeneralDetailsTable("setting");

            return(setting);
        }
コード例 #2
0
        public static string getReportString()
        {
            DBclient DBInstance    = DBclient.Instance;
            string   settingString = DBInstance.getGeneralDetailsTable("lastReport");



            return(settingString);
        }
コード例 #3
0
        private bool connectToExistClient()
        {
            DBclient DBInstance = DBclient.Instance;

            ip = DBInstance.getGeneralDetailsTable("ip");
            string setting = DBInstance.getGeneralDetailsTable("setting");

            Console.WriteLine("setting: " + setting + "\nip: " + ip);
            if (setting.Length > 0)
            {
                id = DBInstance.getGeneralDetailsTable("id");
                Console.WriteLine("connectToExistClient - RECONNECT");
                reConnect();
                playAllTrigers();

                return(true);
            }
            return(false);
        }