コード例 #1
0
        public void DisplayDatabaseInfo(SmartFeedback feedback, bool execute)
        {
            const string cnn = "mongodb://localhost";
            const string dataFolder = @"c:\mongodb\data";
            const string logFolder = @"c:\mongodb\log\mongod.log";
            const string mongoConfigFile = @"c:\mongodb\mongod.cfg";

            feedback.LineBreak().LineBreak().LineBreak();
            feedback.Text("STEP - Display MongoDB Info", feedback.HeaderFontSize, feedback.HeaderColor).LineBreak();
            feedback.Text("MongoDB connection:").Text(cnn, null, Colors.Blue).LineBreak();
            feedback.Text("MongoDB data folder:").Text(dataFolder, null, Colors.Blue).LineBreak();
            feedback.Text("MongoDB log folder:").Text(logFolder, null, Colors.Blue).LineBreak();
            feedback.Text("MongoDB config file:").Text(mongoConfigFile, null, Colors.Blue).LineBreak();

            string dbName = "";
            if (execute)
            {
                dbName = MongoCnn.GetDbConnection().Name;
            }
            feedback.Text("MongoDB database:").Text(dbName, null, Colors.Blue).LineBreak();
            feedback.LineBreak();
        }
コード例 #2
0
        public static void Birth(FileInfo exe, SmartFeedback feedback, bool execute)
        {
            feedback.Text("Start process '" + exe.FullName + "'");
            if (!exe.Exists)
            {
                feedback.Text(" file not found", null, feedback.ErrorColor);
            }
            else
            {
                if (execute)
                {
                    Process.Start(exe.FullName);
                    feedback.Text(" started", null, Colors.Green);
                }
            }

            feedback.LineBreak();
        }
コード例 #3
0
        public static void Kill(SmartFeedback feedback, bool execute, string processName)
        {
            feedback.Text("kill process '" + processName + "'").LineBreak();

            Process p = GetProcessByName(processName);

            if (p != null)
            {
                if (execute)
                {
                    p.Kill();
                    feedback.Text(" killed", null, Colors.Green);
                }
            }
            else
            {
                feedback.Text(" no process by that name", null, Colors.Green);
            }
            feedback.LineBreak();
        }