static void Main(string[] args)
        {
            progArgs argClass = new progArgs();
              try
              {
            int argsNum = args.Length;
            string argType = "";
            string argContent = "";
            foreach (string ar in args)
            {
              argType = ar.Substring(1, 1);
              argContent = ar.Substring(3);
              switch (argType)
              {
            case "f":
              if (System.IO.File.Exists(argContent))
                argClass.configFile = argContent;
              else
              {
                string appPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + argContent;
                //string appPath = System.IO.Directory.GetCurrentDirectory();
                //appPath += "\\" + argContent;
                if (System.IO.File.Exists(appPath))
                { argClass.configFile = appPath; }
                else
                {
                  Debug.Print("AutoIntSys: No config file be found!");
                  return;
                }
              }
              break;
            case "t":
              argClass.testFolder = argContent;
              break;
            case "m":
              argClass.targetMachine = argContent;
              break;
              }
            }
              }
              catch (Exception e)
              {
            Debug.Print("AutoIntSys:Parse arguments error!");
            Debug.Print("AutoIntSys:" + e.Message);
              }
              if (argClass.configFile == "" || argClass.configFile == null || argClass.testFolder == "" || argClass.testFolder == null)
              {
            //Test Machine can using the default value, so if not given from command line, it can still work.
            argClass.ShowHelp();
            return;
            //Not provide the correct parameters for AutoIntSys program, so display some hint and exit
              }

              //string instanceRunName = "Run_" + TestUtility.GetCurrentTime().ToShortDateString() + "_" + TestUtility.GetCurrentTime().ToShortTimeString();

              TestConfigFile tConfig = new TestConfigFile();
              bool success = false;
              //if(argClass.configFile!=null)
              success = TestUtility.LoadConfigFile(ref tConfig, argClass.configFile);
              //else
              //success = TestUtility.LoadConfigFile(ref tConfig, "TestConfig.xml");

              if (success)
              {
            QCOTAClass qcOnline = new QCOTAClass(tConfig);
            if (qcOnline.Connect())
            {
              /*
              QCOperation.QCAttachment taa = new QCOperation.QCAttachment();
              bool upSuccess;
              //upSuccess = (bool)taa.UploadAttachment(qcOnline.getTDConn(), "RUN", "6236", "test.log", "C:\\temp\\");
              upSuccess = (bool)taa.UploadAttachment(qcOnline.getTDConn(), "TEST", "44", "test.log", "C:\\temp\\");
              ArrayList attachments = new ArrayList();
              //attachments = (ArrayList)taa.DownloadAttachment(qcOnline.getTDConn(), "TEST", "C:\\temp", "1406");
              attachments = (ArrayList)taa.DownloadAttachment(qcOnline.getTDConn(), "Test", "1406", "Query_1406.xml", "C:\\temp");
              //attachments = (ArrayList)taa.DownloadAttachment(qcOnline.getTDConn(), "Test", "1406", "*.XML", "C:\\temp");
              */
              TestManage tm = new TestManage(qcOnline.getTDConn(), tConfig);

              bool creatTS = false;
              creatTS = tm.CreateTestSets(argClass.testFolder);
              if (creatTS)
            tm.RunTestSets(argClass.targetMachine);

              qcOnline.DisConnect();
              if (tConfig.RunParameter.UsingQTP)
            TestUtility.KillSpecifyProcess("QTPro");
            }
              }
        }
        static void Main(string[] args)
        {
            ILog AutoLog = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

            AutoLog.Info("AutoIntSys:Start!");
            progArgs argClass = new progArgs();

            try
            {
                int    argsNum    = args.Length;
                string argType    = "";
                string argContent = "";
                foreach (string ar in args)
                {
                    argType    = ar.Substring(1, 1);
                    argContent = ar.Substring(3);
                    switch (argType)
                    {
                    case "f":
                        if (System.IO.File.Exists(argContent))
                        {
                            argClass.configFile = argContent;
                            AutoLog.Info("AutoIntSys: Application config file " + argContent);
                        }
                        else
                        {
                            string appPath = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + argContent;
                            //string appPath = System.IO.Directory.GetCurrentDirectory();
                            //appPath += "\\" + argContent;
                            if (System.IO.File.Exists(appPath))
                            {
                                argClass.configFile = appPath;
                                AutoLog.Info("AutoIntSys: Application config file " + appPath);
                            }
                            else
                            {
                                AutoLog.Info("AutoIntSys: No config file be found!");
                                return;
                            }
                        }
                        break;

                    case "t":
                        argClass.testFolder = argContent;
                        break;

                    case "m":
                        argClass.targetMachine = argContent;
                        break;
                    }
                }
            }
            catch (Exception e)
            {
                AutoLog.Info("AutoIntSys: Parse arguments error!");
                AutoLog.Info("AutoIntSys: " + e.Message);
            }
            if (argClass.configFile == "" || argClass.configFile == null || argClass.testFolder == "" || argClass.testFolder == null)
            {
                //Test Machine can using the default value, so if not given from command line, it can still work.
                argClass.ShowHelp();
                return;
                //Not provide the correct parameters for AutoIntSys program, so display some hint and exit
            }

            //string instanceRunName = "Run_" + TestUtility.GetCurrentTime().ToShortDateString() + "_" + TestUtility.GetCurrentTime().ToShortTimeString();

            TestConfigFile tConfig = new TestConfigFile();
            bool           success = false;

            //if(argClass.configFile!=null)
            success = TestUtility.LoadConfigFile(ref tConfig, argClass.configFile);
            //else
            //success = TestUtility.LoadConfigFile(ref tConfig, "TestConfig.xml");

            if (success)
            {
                AutoLog.Info("AutoIntSys: Configuration File load success!!");
                QCOTAClass qcOnline = new QCOTAClass(tConfig);
                if (qcOnline.Connect())
                {
                    /*
                     * QCOperation.QCAttachment taa = new QCOperation.QCAttachment();
                     * bool upSuccess;
                     * //upSuccess = (bool)taa.UploadAttachment(qcOnline.getTDConn(), "RUN", "6236", "test.log", "C:\\temp\\");
                     * upSuccess = (bool)taa.UploadAttachment(qcOnline.getTDConn(), "TEST", "44", "test.log", "C:\\temp\\");
                     * ArrayList attachments = new ArrayList();
                     * //attachments = (ArrayList)taa.DownloadAttachment(qcOnline.getTDConn(), "TEST", "C:\\temp", "1406");
                     * attachments = (ArrayList)taa.DownloadAttachment(qcOnline.getTDConn(), "Test", "1406", "Query_1406.xml", "C:\\temp");
                     * //attachments = (ArrayList)taa.DownloadAttachment(qcOnline.getTDConn(), "Test", "1406", "*.XML", "C:\\temp");
                     */
                    TestManage tm = new TestManage(qcOnline.getTDConn(), tConfig);

                    bool creatTS = false;
                    creatTS = tm.CreateTestSets(argClass.testFolder);

                    if (creatTS)
                    {
                        tm.RunTestSets(argClass.targetMachine, argClass.configFile);
                    }

                    qcOnline.DisConnect();
                    if (tConfig.RunParameter.UsingQTP)
                    {
                        TestUtility.KillSpecifyProcess("QTPro");
                    }
                }
            }
        }//End of Main