Exemple #1
0
        public static void SetValue()
        {
            string exePath    = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            string configPath = exePath.Substring(0, exePath.LastIndexOf("\\") + 1) + "App\\config\\watconfig.xml";

            if (!File.Exists(configPath))
            {
                return;
            }
            else
            {
                DataSet ds = XmlHelper.GetDataSet(configPath, XmlHelper.XmlType.File);
                //Timer表
                Interval = Convert.ToInt32(DESjiami.DecryptDES(ds.Tables["Timer"].DefaultView[0][0].ToString()));
                //FilePaths表
                HistoryPath     = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["HistoryPath"].ToString());
                WorkingPath     = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["WorkingPath"].ToString());
                SourcePath      = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SourcePath"].ToString());
                SpecPath        = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SpecPath"].ToString());
                SiffPath        = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SiffPath"].ToString());
                SiffHistoryPath = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SiffHistoryPath"].ToString());
                //FTP表
                FtpServerIP = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["IP"].ToString());
                FtpUserID   = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["UserID"].ToString());
                FtpPassword = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["Password"].ToString());
                FtpUri      = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["Uri"].ToString());
            }
        }
Exemple #2
0
        public static void SetValue()
        {
            string exePath    = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            string configPath = exePath.Substring(0, exePath.LastIndexOf("\\") + 1) + "App\\config\\dcmconfig.xml";

            if (!File.Exists(configPath))
            {
                return;
            }
            else
            {
                DataSet ds = XmlHelper.GetDataSet(configPath, XmlHelper.XmlType.File);
                //Timer表
                Interval = Convert.ToInt32(DESjiami.DecryptDES(ds.Tables["Timer"].DefaultView[0][0].ToString()));
                //FilePaths表
                HistoryPath = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["HistoryPath"].ToString());
                WorkingPath = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["WorkingPath"].ToString());
                SourcePath  = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SourcePath"].ToString());
                //DB表
                DataSource = DESjiami.DecryptDES(ds.Tables["DB"].DefaultView[0]["DataSource"].ToString());
                Security   = Convert.ToBoolean(DESjiami.DecryptDES(ds.Tables["DB"].DefaultView[0]["Security"].ToString()));
                Catalog    = DESjiami.DecryptDES(ds.Tables["DB"].DefaultView[0]["Catalog"].ToString());
                UserID     = DESjiami.DecryptDES(ds.Tables["DB"].DefaultView[0]["UserID"].ToString());
                Password   = DESjiami.DecryptDES(ds.Tables["DB"].DefaultView[0]["Password"].ToString());
                Port       = Convert.ToInt32(DESjiami.DecryptDES(ds.Tables["DB"].DefaultView[0]["Port"].ToString()));
            }
        }
Exemple #3
0
        public static void SetValue()
        {
            string exePath    = System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
            string configPath = exePath.Substring(0, exePath.LastIndexOf("\\") + 1) + "App\\config\\hlcmconfig.xml";

            DicConfigPath = exePath.Substring(0, exePath.LastIndexOf("\\") + 1) + "App\\config\\hlcmdic.xml";
            if (!File.Exists(configPath))
            {
                return;
            }
            else
            {
                DataSet ds = XmlHelper.GetDataSet(configPath, XmlHelper.XmlType.File);
                //Timer表
                Interval = Convert.ToInt32(DESjiami.DecryptDES(ds.Tables["Timer"].DefaultView[0][0].ToString()));
                //FilePaths表
                HistoryPath     = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["HistoryPath"].ToString());
                WorkingPath     = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["WorkingPath"].ToString());
                SiffPath        = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SiffPath"].ToString());
                SiffHistoryPath = DESjiami.DecryptDES(ds.Tables["FilePaths"].DefaultView[0]["SiffHistoryPath"].ToString());
                //FTP表
                FtpServerIP = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["IP"].ToString());
                FtpUserID   = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["UserID"].ToString());
                FtpPassword = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["Password"].ToString());
                FtpUri      = DESjiami.DecryptDES(ds.Tables["FTP"].DefaultView[0]["Uri"].ToString());
                //SFTP表
                //SFtpServerIP = DESjiami.DecryptDES(ds.Tables["SFTP"].DefaultView[0]["IP"].ToString());
                //SFtpUserID = DESjiami.DecryptDES(ds.Tables["SFTP"].DefaultView[0]["UserID"].ToString());
                //SFtpPassword = DESjiami.DecryptDES(ds.Tables["SFTP"].DefaultView[0]["Password"].ToString());
            }

            if (!File.Exists(DicConfigPath))
            {
                return;
            }
            else
            {
                DataSet ds = XmlHelper.GetDataSet(configPath, XmlHelper.XmlType.File);
                //TestDictionary表
                DataTable dt = ds.Tables["TestDictionary"];
                foreach (DataRow dr in dt.Rows)
                {
                    DicTestID2Desc.Add(dr["TestDescription"].ToString(), Convert.ToInt16(dr["TestID"].ToString()));
                }
            }
        }