Exemplo n.º 1
0
        /// <summary>
        /// 从GloableSetting中读取LicenseServer信息
        /// </summary>
        /// <returns></returns>
        public List <LicenseServer> GetLicenseServers()
        {
            List <LicenseServer> lstServers = new List <LicenseServer>();

            try
            {
                XmlNode       serversNode             = xmlOperator.SelectNode("Parameters02/LicenseServer", "");
                LicenseServer server                  = null;
                string        LStrVerificationCode001 = Common.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M101);
                foreach (XmlNode node in serversNode.ChildNodes)
                {
                    server = new LicenseServer();
                    if (!node.Name.Equals("LicServer"))
                    {
                        continue;
                    }
                    string str     = xmlOperator.SelectAttrib(node, "P02");
                    int    iEnable = int.Parse(EncryptionAndDecryption.EncryptDecryptString(xmlOperator.SelectAttrib(node, "P02"), LStrVerificationCode001, EncryptionAndDecryption.UMPKeyAndIVType.M101));
                    if (iEnable == 1)
                    {
                        server        = new LicenseServer();
                        server.IsMain = int.Parse(xmlOperator.SelectAttrib(node, "P01"));
                        server.Host   = EncryptionAndDecryption.EncryptDecryptString(xmlOperator.SelectAttrib(node, "P03"), LStrVerificationCode001, EncryptionAndDecryption.UMPKeyAndIVType.M101);
                        server.Port   = int.Parse(EncryptionAndDecryption.EncryptDecryptString(xmlOperator.SelectAttrib(node, "P04"), LStrVerificationCode001, EncryptionAndDecryption.UMPKeyAndIVType.M101));
                        lstServers.Add(server);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(lstServers);
        }
        public void ShowInformation(string AStrAgentID)
        {
            string LStrSkillID             = string.Empty;
            string LStrSkillCode           = string.Empty;
            string LStrSkillName           = string.Empty;
            string LStrVerificationCode104 = string.Empty;

            try
            {
                ShowSkillGroupTreeView();
                UCTreeViewYoung LUCTreeViewYoung = GridObjectSelect.Children[0] as UCTreeViewYoung;
                ObjectListView.Items.Clear();
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
                DataRow[] LDataRowSA = App.IDataTable11201SA.Select("C004 = " + AStrAgentID, "C003 ASC");
                foreach (DataRow LDataRowSingleSkill in LDataRowSA)
                {
                    LStrSkillID = LDataRowSingleSkill["C003"].ToString();
                    DataRow[] LDataRowSkill = App.IDataTable11009.Select("C001 = " + LStrSkillID);
                    LStrSkillCode = LDataRowSkill[0]["C006"].ToString();
                    LStrSkillName = LDataRowSkill[0]["C008"].ToString();
                    LStrSkillCode = EncryptionAndDecryption.EncryptDecryptString(LStrSkillCode, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                    ListViewItem LListViewItemSkill = new ListViewItem();
                    LListViewItemSkill.Content = new ObjctColumnDefine(LStrSkillID, LStrSkillCode, LStrSkillName, "");
                    LListViewItemSkill.Height  = 26;
                    LListViewItemSkill.Margin  = new Thickness(0, 1, 0, 1);
                    ObjectListView.Items.Add(LListViewItemSkill);
                    LUCTreeViewYoung.SetItemCheckedStatus(true, LStrSkillID);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
        private void ShowMyControlOrg(TreeViewItem ATreeViewItem, string AStrParentOrgID)
        {
            string LStrVerificationCode104 = string.Empty;
            string LStrOrgID      = string.Empty;
            string LStrOrgName    = string.Empty;
            string LStrOrgParent  = string.Empty;
            string LStrImagesPath = string.Empty;

            try
            {
                LStrImagesPath          = System.IO.Path.Combine(App.GClassSessionInfo.LocalMachineInfo.StrCommonApplicationData, @"UMP.Client\Themes", App.GClassSessionInfo.ThemeInfo.Name, @"Images\S1103");
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

                DataRow[] LDataRowOrg = App.IDataTable11006.Select("C004 = " + AStrParentOrgID);
                foreach (DataRow LDataRowSingleOrg in LDataRowOrg)
                {
                    LStrOrgID = LDataRowSingleOrg["C001"].ToString();
                    if (App.IDataTable11201UO.Select("C004 = " + LStrOrgID).Length <= 0)
                    {
                        continue;
                    }
                    LStrOrgName = LDataRowSingleOrg["C002"].ToString();
                    LStrOrgName = EncryptionAndDecryption.EncryptDecryptString(LStrOrgName, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                    TreeViewItem LTreeViewItemSubOrg = new TreeViewItem();
                    LTreeViewItemSubOrg.Header      = LStrOrgName;
                    LTreeViewItemSubOrg.DataContext = LStrOrgID;
                    TreeViewItemProps.SetItemImageName(LTreeViewItemSubOrg, LStrImagesPath + @"\S1103004.ico");
                    ATreeViewItem.Items.Add(LTreeViewItemSubOrg);
                    ShowMyControlOrg(LTreeViewItemSubOrg, LStrOrgID);
                    IListrTVItemAllOrg.Add(LTreeViewItemSubOrg);
                }
            }
            catch { }
        }
Exemplo n.º 4
0
        public static string EncryptDecryptString(string AStrSource, string AStrVerificationCode, int AIntKeyIVID)
        {
            string LStrRetrun = string.Empty;

            EncryptionAndDecryption.UMPKeyAndIVType LKeyIVID = EncryptionAndDecryption.UMPKeyAndIVType.M004;

            if (AIntKeyIVID == 1)
            {
                LKeyIVID = EncryptionAndDecryption.UMPKeyAndIVType.M001;
            }
            if (AIntKeyIVID == 4)
            {
                LKeyIVID = EncryptionAndDecryption.UMPKeyAndIVType.M004;
            }
            if (AIntKeyIVID == 101)
            {
                LKeyIVID = EncryptionAndDecryption.UMPKeyAndIVType.M101;
            }
            if (AIntKeyIVID == 104)
            {
                LKeyIVID = EncryptionAndDecryption.UMPKeyAndIVType.M104;
            }

            LStrRetrun = EncryptionAndDecryption.EncryptDecryptString(AStrSource, AStrVerificationCode, LKeyIVID);
            return(LStrRetrun);
        }
Exemplo n.º 5
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            //string IStrSpliterChar = AscCodeToChr(27);
            //string sss = "1548A4D55498677F104E1E81696303B8CD39D8E3949F3EA151070AD528AE36B70270791235E7C924F7495026A019989466309A105052AD7CFA0E543A516095326001C0FBB6432B8E64BB3AC91C6A5C20FB4410CED9428215EB417415B4A20E289498E735802C97B401D73D7603BF6E7E61D79D1FC82612490D8D21BCCFA4C963ACFFF6D75935AD892BAC7E33F607ADFA81D2A29D292DDCD753E90819FCA4C4E17CB0824DAF01E0A88A589B0EF3749D5F61F5E22BAF3720A7A56C80DC9FA429EAD50D0A21EE4F698537A4956C603BBBE00E6A14C6379558D7D15EF8F680B3CA8B53940F06F7F66BE3757DCE4844ACF314A1D406F463E7E74E76A1C7806936B13ADA7250D0BE8795CCFAE81603BE068015C79AD10CF32E080B2373BEE9777D6D7FAF6FB7A110FADBC4D0B8BD11B275452D6EB0CF91428A2EA69F501130D85076A1BDF85451D49E253038D12EB9E19729ADFFD82C519BD2DFAB265617165B5EE73FD5BCE172168A575BC2601E3C2BC0C894A93FB332A80BE6975C995E57CB33CA92AC6C8DBA72F52D2B369C3A715F5E3BA8DABBB68864F6C890E79B5D97E596592BD50357DE9EE4AF6B16FB08FECF69D8E08F52191CFEE4408D3B30A56B31719156368B0FE6C3B34D2CD4CE297381288C06D72E30BE0D10E12E110EBBABC3BC27B15E830E4A5487047BEDEF80A6FF4B368D20AD8518B57132B70A20AC5916DC69014180141E02C4CB7BCF50DAC253909AB8439776DE1B3C52E04C3685000C16B4EC8705C0757EDD7D04C1670BD78974F9B0086C0FB96E60967A0930D83283CF9416B90BA1CD2955D41CF996EE3B9C13025E76C6EE6336632097462E056CF20BED7F80F89771470A3D76C4E1989435AC118E83E25D26F67E73EE4868E4E071C1852636DC1F56ED5C485AECF0AD0DA09DC6E0A09D9EADE457D8844A315281753C74F80A9E6A2869F5C94B52070976ACFE3A2B5B20D86E5EA09B45E4DD497E24FC6C9A34AFFEF8BB26418DEF3BCF50C74339A2576417444C39FEFFE79AED7E2B0B4B884EA8198CBBED9E2B00B4BD157B6A5DBD2DB19878A09DF693FA2435C89584E1BC61BC28D0E674030C50DD2E0528B96D40FA7F8393B92037D562D39CC697DC16F0D56B0D34BD3C1F479FD5817A661B03C4D27D107CE71F2AD79B4E9DFFF88FBBF88D122B16D7E222EE3C87E457AF96A8EF66A26B927449FD9302229BA554FB7729";
            //string[] LStrUserSendData = sss.Split(IStrSpliterChar.ToArray());

            //int LIntDataLength = LStrUserSendData.Length;
            //string LStrVerificationCode104 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
            //for (int LIntDataLoop = 0; LIntDataLoop < LIntDataLength; LIntDataLoop++)
            //{
            //    LStrUserSendData[LIntDataLoop] = EncryptionAndDecryption.EncryptDecryptString(LStrUserSendData[LIntDataLoop], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
            //}

            //string[] LstrG002 = LStrUserSendData[1].Split(IStrSpliterChar.ToArray());

            string ss = "93464B864C3E105312FA624E834FEA8D4EF618CC36A14F289D85B964E89B7C6C09D6FC0A2F7FCAE81CCA67F627AD5FE8796B577213760C74AC1CA30D8A103EE6995149A4BDE98F604826F4F12E75739AD0E25EF6EEDAE6FA656030F61875A080FDA5469B25EB5D9A79FC8EFFCEAB2CE33B1ADB3D9BBAB5B7C2E9A387387842DD";
            string d  = "93464B864C3E105312FA624E834FEA8D";
            string LStrVerificationCode025 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M025);
            string LStrVerificationCode125 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M125);

            ss = EncryptionAndDecryption.EncryptDecryptString(ss, LStrVerificationCode125, EncryptionAndDecryption.UMPKeyAndIVType.M125);
            if (ss.Equals("333333"))
            {
                MessageBox.Show(ss);
            }
        }
        public void ShowConfirmInformation(List <string> AListStrDatabaseServerProfile, OperationParameters AOperationParameters22, OperationParameters AOperationParameters23)
        {
            string LStrVerificationCode104 = string.Empty;

            try
            {
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

                GridConfirmInformation.IsEnabled = false;
                IBoolHaveError   = false;
                IParameterStep22 = AOperationParameters22;
                IParameterStep23 = AOperationParameters23;

                TextBoxServerName.Text = EncryptionAndDecryption.EncryptDecryptString(AListStrDatabaseServerProfile[0], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                TextBoxServerPort.Text = EncryptionAndDecryption.EncryptDecryptString(AListStrDatabaseServerProfile[1], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);

                IPageParent.ShowWaitProgressBar(true);
                IBackgroundWorkerObtainDatabasesLogins = new BackgroundWorker();
                IBackgroundWorkerObtainDatabasesLogins.RunWorkerCompleted += IBackgroundWorkerObtainDatabasesLogins_RunWorkerCompleted;
                IBackgroundWorkerObtainDatabasesLogins.DoWork             += IBackgroundWorkerObtainDatabasesLogins_DoWork;
                IBackgroundWorkerObtainDatabasesLogins.RunWorkerAsync(AListStrDatabaseServerProfile);
            }
            catch
            {
                IPageParent.ShowWaitProgressBar(false);
                GridConfirmInformation.IsEnabled = true;
                IBoolHaveError = true;
                if (IBackgroundWorkerObtainDatabasesLogins != null)
                {
                    IBackgroundWorkerObtainDatabasesLogins.Dispose();
                    IBackgroundWorkerObtainDatabasesLogins = null;
                }
            }
        }
        public void InitCreatedDatabaseInformation(List <string> AListStrDatabaseProfile)
        {
            string LStrVerificationCode104 = string.Empty;
            string LStrLoginPassword       = string.Empty;
            int    LIntPasswordLength      = 0;

            try
            {
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

                if (IPageParent.IStrDatabaseType == "2")
                {
                    TextBoxPDatabaseType.Text = App.GetDisplayCharater("M02007");
                }
                if (IPageParent.IStrDatabaseType == "3")
                {
                    TextBoxPDatabaseType.Text = App.GetDisplayCharater("M02008");
                }

                TextBoxPServerName.Text           = AListStrDatabaseProfile[0];
                TextBoxPServerPort.Text           = AListStrDatabaseProfile[1];
                TextBoxPDBOrServiceName.Text      = AListStrDatabaseProfile[4];
                TextBoxPLoginName.Text            = AListStrDatabaseProfile[2];
                LStrLoginPassword                 = EncryptionAndDecryption.EncryptDecryptString(AListStrDatabaseProfile[3], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                TextBoxPLoginPassword.DataContext = LStrLoginPassword;
                LIntPasswordLength                = LStrLoginPassword.Length;
                LStrLoginPassword                 = string.Empty;
                for (int LIntLoopPwdLength = 0; LIntLoopPwdLength < LIntPasswordLength; LIntLoopPwdLength++)
                {
                    LStrLoginPassword += "*";
                }
                TextBoxPLoginPassword.Text = LStrLoginPassword;
            }
            catch { }
        }
Exemplo n.º 8
0
        private void CheckAndInitType213Data()
        {
            DataRow[] LDataRowLicenseServerCheck = App.IListDataSetReturn[2].Tables[0].Select("C001 = 2130000000000000001 OR C001 = 2130000000000000002", "C001 ASC");
            if (LDataRowLicenseServerCheck.Length <= 0)
            {
                DataRow LDataRowNew1 = App.IListDataSetReturn[2].Tables[0].NewRow();
                LDataRowNew1.BeginEdit();
                LDataRowNew1["C001"] = 2130000000000000001;
                LDataRowNew1["C002"] = 1;
                LDataRowNew1["C011"] = "0";
                LDataRowNew1["C012"] = "1";
                LDataRowNew1["C013"] = "I";
                LDataRowNew1["C014"] = EncryptionAndDecryption.EncryptDecryptString("3420", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
                LDataRowNew1["C017"] = EncryptionAndDecryption.EncryptDecryptString("0.0.0.0", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);;
                LDataRowNew1["C018"] = "";
                LDataRowNew1.EndEdit();
                App.IListDataSetReturn[2].Tables[0].Rows.Add(LDataRowNew1);

                DataRow LDataRowNew2 = App.IListDataSetReturn[2].Tables[0].NewRow();
                LDataRowNew2.BeginEdit();
                LDataRowNew2["C001"] = 2130000000000000002;
                LDataRowNew2["C002"] = 1;
                LDataRowNew2["C011"] = "0";
                LDataRowNew2["C012"] = "2";
                LDataRowNew2["C013"] = "I";
                LDataRowNew2["C014"] = EncryptionAndDecryption.EncryptDecryptString("3420", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
                LDataRowNew2["C017"] = EncryptionAndDecryption.EncryptDecryptString("0.0.0.0", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);;
                LDataRowNew2["C018"] = "";
                LDataRowNew2.EndEdit();
                App.IListDataSetReturn[2].Tables[0].Rows.Add(LDataRowNew2);
            }
        }
Exemplo n.º 9
0
        private static void Get11010203MinMaxDefValue(ref int AIntMinValue, ref int AIntMaxValue, ref int AIntDefValue)
        {
            string LStrVerificationCode104 = string.Empty;
            string LStrParameterValueDB    = string.Empty;

            DataRow[] LDataRow11010101 = GDataTable11001.Select("C003 = 11010202");
            LStrVerificationCode104 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

            LStrParameterValueDB = LDataRow11010101[0]["C006"].ToString();
            LStrParameterValueDB = EncryptionAndDecryption.EncryptDecryptString(LStrParameterValueDB, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
            LStrParameterValueDB = LStrParameterValueDB.Substring(8);

            AIntMinValue = 1;
            if (LStrParameterValueDB == "0")
            {
                AIntMaxValue = 998;
                AIntDefValue = 7;
            }
            else
            {
                AIntMaxValue = int.Parse(LStrParameterValueDB) - 1;
                AIntDefValue = AIntMaxValue;
                if (AIntMaxValue > 7)
                {
                    AIntDefValue = 7;
                }
            }
        }
Exemplo n.º 10
0
 private void InitConnectedLoginArgs(int AIntServerIndex)
 {
     try
     {
         List <List <string> > LListListStrConnectArgsList = IConnectedServerInformation.ListListStrConnectedArgs[AIntServerIndex];
         ComboBoxLoginName.Items.Clear();
         foreach (List <string> LListStrSingleConnectArgs in LListListStrConnectArgsList)
         {
             ComboBoxItem LComboBoxItemLoginName = new ComboBoxItem();
             LComboBoxItemLoginName.Background  = Brushes.Transparent;
             LComboBoxItemLoginName.Margin      = new Thickness(0, 1, 0, 1);
             LComboBoxItemLoginName.Style       = (Style)App.Current.Resources["ComboBoxItemNormalStyle"];
             LComboBoxItemLoginName.Height      = 24;
             LComboBoxItemLoginName.Content     = EncryptionAndDecryption.EncryptDecryptString(LListStrSingleConnectArgs[2], IStrVerificationCode101, EncryptionAndDecryption.UMPKeyAndIVType.M101); //登录名
             LComboBoxItemLoginName.DataContext = LListStrSingleConnectArgs[1] + App.GStrSpliterChar + LListStrSingleConnectArgs[3];                                                                 //记住密码 + char(27) + 密码
             LComboBoxItemLoginName.Tag         = LListStrSingleConnectArgs[0];                                                                                                                      //最后登录的用户
             ComboBoxLoginName.Items.Add(LComboBoxItemLoginName);
         }
         CheckBoxRemberPassword.IsChecked    = false;
         ComboBoxLoginName.SelectionChanged += ComboBoxObjectSelectionChanged;
         foreach (ComboBoxItem LComboBoxItemSingleConnectArgs in ComboBoxLoginName.Items)
         {
             if (LComboBoxItemSingleConnectArgs.Tag.ToString() == "1")
             {
                 LComboBoxItemSingleConnectArgs.IsSelected = true; break;
             }
         }
         IBoolConnectArgsChanged = false;
     }
     catch { }
 }
Exemplo n.º 11
0
        private string GetObjectContentForExpanderHeader(OperationParameters AParameters)
        {
            string LStrReturn      = string.Empty;
            string LStrTypeIDLeft3 = string.Empty;

            try
            {
                LStrTypeIDLeft3 = AParameters.StrObjectTag.Substring(0, 3);
                Type LTypeObject = AParameters.ObjectSource3.GetType();
                if (LTypeObject == typeof(ListViewItem))
                {
                    ListViewItem LListViewItemObject = AParameters.ObjectSource3 as ListViewItem;
                    DataRow      LDataRowInfo        = LListViewItemObject.Tag as DataRow;
                    if (LStrTypeIDLeft3 == "212")
                    {
                        LStrReturn = LDataRowInfo["C017"].ToString();
                        LStrReturn = EncryptionAndDecryption.EncryptDecryptString(LStrReturn, IStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                    }
                    return(LStrReturn);
                }
                if (LTypeObject == typeof(TreeViewItem))
                {
                    TreeViewItem LTreeViewItemObject = AParameters.ObjectSource3 as TreeViewItem;
                    LStrReturn = LTreeViewItemObject.Header.ToString();
                    return(LStrReturn);
                }
            }
            catch { LStrReturn = string.Empty; }

            return(LStrReturn);
        }
Exemplo n.º 12
0
        private void WriteElement2DataSet()
        {
            string LStrServerIP   = string.Empty;
            string LStrServerPort = string.Empty;

            if (!IBoolCanEdit)
            {
                return;
            }

            UCInputType203 LUCServerIPAddress = GridDecServer01.Children[0] as UCInputType203;

            LStrServerIP = LUCServerIPAddress.GetElementData();

            UCInputType103 LUCServerPort = GridDecServer02.Children[0] as UCInputType103;

            LStrServerPort = LUCServerPort.GetElementData();

            DataRow[] LDataRowDecServer = App.IListDataSetReturn[1].Tables[0].Select("C001 = " + IStrCurrentDecID);

            LDataRowDecServer[0]["C014"] = EncryptionAndDecryption.EncryptDecryptString(LStrServerPort, IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
            LDataRowDecServer[0]["C017"] = EncryptionAndDecryption.EncryptDecryptString(LStrServerIP, IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);

            OperationEventArgs LEventArgs = new OperationEventArgs();

            LEventArgs.StrObjectTag  = "S212";
            LEventArgs.ObjectSource0 = IStrCurrentDecID;
            IPageTopParent.RefreshTreeViewViewData(LEventArgs);
        }
Exemplo n.º 13
0
        /// <summary>
        /// 根据ModuleNumber从voicexml中读取IP
        /// </summary>
        /// <param name="strModuleNumber"></param>
        /// <returns></returns>
        public static string GetVoiceServerHostByModuleNumber(int strModuleNumber)
        {
            string strHost = string.Empty;

            try
            {
                DirectoryInfo dir = new DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\VoiceCyber\\UMP\\config");
                if (!dir.Exists)
                {
                    UMPService00.WriteLog("Config director is not exists");
                    return(strHost);
                }
                string   strFileName        = string.Format("umpparam_voc{0:0000}.xml", strModuleNumber);
                string   strVoiceleFilePath = dir.FullName + "\\" + strFileName;
                FileInfo fileInfo           = new FileInfo(strVoiceleFilePath);
                if (!fileInfo.Exists)
                {
                    UMPService00.WriteLog("umpparam_simp.xml is not exists");
                    return(strHost);
                }
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(strVoiceleFilePath);
                XMLOperator xmlOperator = new XMLOperator(xmlDoc);
                XmlNode     hostNode    = xmlOperator.SelectNode("Configurations/Configuration/Sites/Site/VoiceServers/VoiceServer/HostAddress", "");
                strHost = xmlOperator.SelectAttrib(hostNode, "Value");
                string LStrVerificationCode101 = Common.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M101);
                strHost = EncryptionAndDecryption.EncryptDecryptString(strHost, LStrVerificationCode101, EncryptionAndDecryption.UMPKeyAndIVType.M101);
                UMPService00.WriteLog(EventLogEntryType.Warning, "Host = " + strHost);
            }
            catch (Exception ex)
            {
                UMPService00.WriteLog("GetVoiceServerHostByModuleNumber error:" + ex.Message);
            }
            return(strHost);
        }
        /// <summary>
        /// 用户登录(检查密码是否正确 是否已经在另一台机器登录等)
        /// </summary>
        /// <param name="strHost"></param>
        /// <param name="strPort"></param>
        /// <param name="strUser"></param>
        /// <param name="strPwd"></param>
        /// <param name="strLoginMethod"></param>
        /// <param name="strClientMachineName"></param>
        /// <returns></returns>
        public static OperationDataArgs UserLogin(string strHost, string strPort, string strUser, string strPwd, string strLoginMethod, string strClientMachineName)
        {
            OperationDataArgs  result  = new OperationDataArgs();
            BasicHttpBinding   binding = Common.CreateBasicHttpBinding(60);
            EndpointAddress    adress  = Common.CreateEndPoint("HTTP", strHost, strPort, "WcfServices", "Service00000");
            Service00000Client client  = new Service00000Client(binding, adress);

            try
            {
                List <string> lstParams = new List <string>();
                string        LStrVerificationCode004 = Common.CreateVerificationCode(PFShareClassesC.EncryptionAndDecryption.UMPKeyAndIVType.M004);
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strUser, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strPwd, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strLoginMethod, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(strClientMachineName, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                result = client.OperationMethodA(11, lstParams);
            }
            catch (Exception ex)
            {
                result.BoolReturn   = false;
                result.StringReturn = ex.Message;
            }
            finally
            {
                if (client.State == CommunicationState.Opened)
                {
                    client.Close();
                }
            }
            return(result);
        }
Exemplo n.º 15
0
        public void ShowParameterEditStyle(DataRow ADataRowParamInfo)
        {
            string LStr11001003            = string.Empty; //参数编码
            string LStrVerificationCode104 = string.Empty;
            string LStrParameterValueDB    = string.Empty;

            try
            {
                IDataRowCurrent = ADataRowParamInfo;
                if (IPageParent != null)
                {
                    IPageParent.IOperationEvent += IPageParent_IOperationEvent;
                }
                LStr11001003              = ADataRowParamInfo["C003"].ToString();
                LStrVerificationCode104   = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
                RadioButtonValue1.Content = App.GetDisplayCharater("Page00000A", "Act" + LStr11001003 + "V1");
                RadioButtonValue0.Content = App.GetDisplayCharater("Page00000A", "Act" + LStr11001003 + "V0");
                LStrParameterValueDB      = ADataRowParamInfo["C006"].ToString();
                LStrParameterValueDB      = EncryptionAndDecryption.EncryptDecryptString(LStrParameterValueDB, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrParameterValueDB      = LStrParameterValueDB.Substring(8);
                if (LStrParameterValueDB == "1")
                {
                    RadioButtonValue1.IsChecked = true;
                }
                else
                {
                    RadioButtonValue0.IsChecked = true;
                }
                IPageParent.IChangeLanguageEvent += IPageParent_IChangeLanguageEvent;
            }
            catch { }
        }
Exemplo n.º 16
0
        private void ShowControlAgentUser(TreeViewItem ATreeViewItem, string AStrOrgID, UCTreeViewYoung AUCTreeViewYoung, string AStrAgentID)
        {
            string LStrUserID              = string.Empty;
            string LStrUserAccount         = string.Empty;
            string LStrUserName            = string.Empty;
            string LStrVerificationCode104 = string.Empty;
            string LStrImagesPath          = string.Empty;

            LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
            LStrImagesPath          = System.IO.Path.Combine(App.GClassSessionInfo.LocalMachineInfo.StrCommonApplicationData, @"UMP.Client\Themes", App.GClassSessionInfo.ThemeInfo.Name, @"Images\S1103");
            DataRow[] LDataRowOrgUsers = App.IDataTable11005.Select("C006 = " + AStrOrgID, "C001 ASC");
            foreach (DataRow LDataRowSingleOrgUser in LDataRowOrgUsers)
            {
                LStrUserID = LDataRowSingleOrgUser["C001"].ToString();
                if (App.IDataTable11201UA.Select("C003 = " + LStrUserID + " AND C004 = " + AStrAgentID).Length <= 0)
                {
                    continue;
                }
                LStrUserAccount = LDataRowSingleOrgUser["C002"].ToString();
                LStrUserAccount = EncryptionAndDecryption.EncryptDecryptString(LStrUserAccount, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrUserName    = LDataRowSingleOrgUser["C003"].ToString();
                LStrUserName    = EncryptionAndDecryption.EncryptDecryptString(LStrUserName, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);

                TreeViewItem LTreeViewItemUser = new TreeViewItem();
                LTreeViewItemUser.Header      = LStrUserAccount + " (" + LStrUserName + ")";
                LTreeViewItemUser.DataContext = LStrUserID;
                TreeViewItemProps.SetItemImageName(LTreeViewItemUser, LStrImagesPath + @"\S1103005.png");
                ATreeViewItem.Items.Add(LTreeViewItemUser);
                AUCTreeViewYoung.SetItemCheckedStatus(true, LStrUserID);
            }
            //AUCTreeViewYoung.SetItemCheckedDisabled(false, "102" + App.GClassSessionInfo.RentInfo.Token + "00000000001");
            //AUCTreeViewYoung.SetItemCheckedDisabled(false, App.GClassSessionInfo.UserInfo.UserID.ToString());
        }
        public static OperationDataArgs UserLogOff()
        {
            OperationDataArgs  result  = new OperationDataArgs();
            BasicHttpBinding   binding = Common.CreateBasicHttpBinding(60);
            EndpointAddress    adress  = Common.CreateEndPoint("HTTP", App.GCurrentUmpServer.Host, App.GCurrentUmpServer.Port, "WcfServices", "Service00000");
            Service00000Client client  = new Service00000Client(binding, adress);

            try
            {
                List <string> lstParams = new List <string>();
                string        LStrVerificationCode004 = Common.CreateVerificationCode(PFShareClassesC.EncryptionAndDecryption.UMPKeyAndIVType.M004);
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(App.GCurrentUser.TenantID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(App.GCurrentUser.UserID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                lstParams.Add(EncryptionAndDecryption.EncryptDecryptString(App.GCurrentUser.SessionID, LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004));
                result = client.OperationMethodA(12, lstParams);
            }
            catch (Exception ex)
            {
                result.BoolReturn   = false;
                result.StringReturn = ex.Message;
            }
            finally
            {
                if (client.State == CommunicationState.Opened)
                {
                    client.Close();
                }
            }
            return(result);
        }
Exemplo n.º 18
0
        private void ShowMyControlUser(TreeViewItem ATreeViewItem, string AStrOrgID, UCTreeViewYoung AUCTreeViewYoung)
        {
            string LStrUserID              = string.Empty;
            string LStrUserAccount         = string.Empty;
            string LStrUserName            = string.Empty;
            string LStrVerificationCode104 = string.Empty;
            string LStrImagesPath          = string.Empty;

            LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
            LStrImagesPath          = System.IO.Path.Combine(App.GClassSessionInfo.LocalMachineInfo.StrCommonApplicationData, @"UMP.Client\Themes", App.GClassSessionInfo.ThemeInfo.Name, @"Images\S1103");
            DataRow[] LDataRowUsers = App.IDataTable11005.Select("C006 = " + AStrOrgID, "C001 ASC");
            foreach (DataRow LDataRowSingleUser in LDataRowUsers)
            {
                LStrUserID = LDataRowSingleUser["C001"].ToString();
                if (App.IDataTable11201UU.Select("C004 = " + LStrUserID).Length <= 0)
                {
                    continue;
                }
                LStrUserAccount = LDataRowSingleUser["C002"].ToString();
                LStrUserAccount = EncryptionAndDecryption.EncryptDecryptString(LStrUserAccount, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrUserName    = LDataRowSingleUser["C003"].ToString();
                LStrUserName    = EncryptionAndDecryption.EncryptDecryptString(LStrUserName, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);

                TreeViewItem LTreeViewItemUser = AUCTreeViewYoung.AddTreeViewItem(ATreeViewItem, false, LStrImagesPath + @"\S1103005.png", LStrUserAccount + " (" + LStrUserName + ")", LStrUserID);
            }
        }
Exemplo n.º 19
0
        public void ShowParameterEditStyle(DataRow ADataRowParamInfo)
        {
            string LStr11001003            = string.Empty; //参数编码
            string LStrVerificationCode104 = string.Empty;
            string LStrParameterValueDB    = string.Empty;

            int LIntMinValue = 0, LIntMaxValue = 0, LIntDefValue = 0;

            try
            {
                IDataRowCurrent = ADataRowParamInfo;
                if (IPageParent != null)
                {
                    IPageParent.IOperationEvent += IPageParent_IOperationEvent;
                }

                LStr11001003            = ADataRowParamInfo["C003"].ToString();
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

                LStrParameterValueDB = ADataRowParamInfo["C006"].ToString();
                LStrParameterValueDB = EncryptionAndDecryption.EncryptDecryptString(LStrParameterValueDB, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrParameterValueDB = LStrParameterValueDB.Substring(8);
                if (App.GetParameterMinMaxDefValue(LStr11001003, ref LIntMinValue, ref LIntMaxValue, ref LIntDefValue))
                {
                    TextBoxPositiveInteger.SetMinMaxDefaultValue(LIntMinValue, LIntMaxValue, LIntDefValue);
                }

                TextBoxPositiveInteger.SetElementData(LStrParameterValueDB);
                IPageParent.IChangeLanguageEvent += IPageParent_IChangeLanguageEvent;
            }
            catch { }
        }
Exemplo n.º 20
0
        public void ShowParameterEditStyle(DataRow ADataRowParamInfo)
        {
            string LStr11001003            = string.Empty; //参数编码
            string LStrVerificationCode104 = string.Empty;
            string LStrParameterValueDB    = string.Empty;

            try
            {
                IDataRowCurrent = ADataRowParamInfo;
                if (IPageParent != null)
                {
                    IPageParent.IOperationEvent += IPageParent_IOperationEvent;
                }
                LStr11001003 = ADataRowParamInfo["C003"].ToString();
                LoadThisDataEnumeration(LStr11001003);
                LStrVerificationCode104 = S1106App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrParameterValueDB    = ADataRowParamInfo["C006"].ToString();
                LStrParameterValueDB    = EncryptionAndDecryption.EncryptDecryptString(LStrParameterValueDB, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                LStrParameterValueDB    = LStrParameterValueDB.Substring(8);

                foreach (RadioButton LRadioButtonSingleItem in StackPanelDataEnumeration.Children)
                {
                    if (LRadioButtonSingleItem.DataContext.ToString() == LStrParameterValueDB)
                    {
                        LRadioButtonSingleItem.IsChecked = true; break;
                    }
                }

                IPageParent.IChangeLanguageEvent += IPageParent_IChangeLanguageEvent;
            }
            catch { }
        }
Exemplo n.º 21
0
 private void CheckAndInitType212Data()
 {
     DataRow[] LDataRowDECServerCheck = App.IListDataSetReturn[1].Tables[0].Select("C001 >= 2120000000000000001 AND C001 < 2130000000000000000");
     if (LDataRowDECServerCheck.Length > 0)
     {
         return;
     }
     for (int LIntLoopServer = 1; LIntLoopServer <= 15; LIntLoopServer++)
     {
         DataRow LDataRowNew = App.IListDataSetReturn[1].Tables[0].NewRow();
         LDataRowNew.BeginEdit();
         LDataRowNew["C001"] = 2120000000000000000 + LIntLoopServer;
         LDataRowNew["C002"] = 1;
         LDataRowNew["C011"] = "0";
         LDataRowNew["C012"] = "1";
         LDataRowNew["C013"] = "I";
         LDataRowNew["C014"] = EncryptionAndDecryption.EncryptDecryptString("3072", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
         LDataRowNew["C015"] = EncryptionAndDecryption.EncryptDecryptString("256", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
         LDataRowNew["C016"] = EncryptionAndDecryption.EncryptDecryptString("1", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);
         LDataRowNew["C017"] = EncryptionAndDecryption.EncryptDecryptString("0.0.0.0", IStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004);;
         LDataRowNew["C018"] = "";
         LDataRowNew.EndEdit();
         App.IListDataSetReturn[1].Tables[0].Rows.Add(LDataRowNew);
     }
 }
Exemplo n.º 22
0
        public void ShowConfirmInformation(List <string> AListStrDatabaseServerProfile, MamtOperationEventArgs AOperationParameters22, MamtOperationEventArgs AOperationParameters23)
        {
            string LStrVerificationCode104 = string.Empty;

            try
            {
                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);

                GridConfirmInformation.IsEnabled = false;
                IBoolHaveError   = false;
                IParameterStep22 = AOperationParameters22;
                IParameterStep23 = AOperationParameters23;

                TextBoxServerName.Text = EncryptionAndDecryption.EncryptDecryptString(AListStrDatabaseServerProfile[0], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                TextBoxServerPort.Text = EncryptionAndDecryption.EncryptDecryptString(AListStrDatabaseServerProfile[1], LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);

                App.ShowCurrentStatus(1, App.GetDisplayCharater("M02086"));
                IBackgroundWorkerObtainDatabasesLogins = new BackgroundWorker();
                IBackgroundWorkerObtainDatabasesLogins.RunWorkerCompleted += IBackgroundWorkerObtainDatabasesLogins_RunWorkerCompleted;
                IBackgroundWorkerObtainDatabasesLogins.DoWork             += IBackgroundWorkerObtainDatabasesLogins_DoWork;
                IBackgroundWorkerObtainDatabasesLogins.RunWorkerAsync(AListStrDatabaseServerProfile);
            }
            catch
            {
                App.ShowCurrentStatus(int.MaxValue, string.Empty);
                GridConfirmInformation.IsEnabled = true;
                IBoolHaveError = true;
                if (IBackgroundWorkerObtainDatabasesLogins != null)
                {
                    IBackgroundWorkerObtainDatabasesLogins.Dispose();
                    IBackgroundWorkerObtainDatabasesLogins = null;
                }
            }
        }
Exemplo n.º 23
0
        public static string DecryptFromDB(string strSource)
        {
            string strReturn = EncryptionAndDecryption.EncryptDecryptString(strSource,
                                                                            CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M102),
                                                                            EncryptionAndDecryption.UMPKeyAndIVType.M102);

            return(strReturn);
        }
Exemplo n.º 24
0
        private static string EncryptToDB(string strSource)
        {
            string strReturn = EncryptionAndDecryption.EncryptDecryptString(strSource,
                                                                            CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M002),
                                                                            EncryptionAndDecryption.UMPKeyAndIVType.M002);

            return(strReturn);
        }
Exemplo n.º 25
0
        public static string DecryptString(string strSource)
        {
            string strTemp = EncryptionAndDecryption.EncryptDecryptString(strSource,
                                                                          CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104),
                                                                          EncryptionAndDecryption.UMPKeyAndIVType.M104);

            return(strTemp);
        }
Exemplo n.º 26
0
        private string DecryptFromDB103(string strSource)
        {
            string strReturn = EncryptionAndDecryption.EncryptDecryptString(strSource,
                                                                            CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M103),
                                                                            EncryptionAndDecryption.UMPKeyAndIVType.M103);

            return(strReturn);
        }
Exemplo n.º 27
0
        private string DecryptNamesFromDB(string strSource)
        {
            string strTemp = EncryptionAndDecryption.EncryptDecryptString(strSource,
                                                                          CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M102),
                                                                          EncryptionAndDecryption.UMPKeyAndIVType.M102);

            return(strTemp);
        }
Exemplo n.º 28
0
        private void RemoveSkillGroup()
        {
            List <string> LListStrWcfArgs         = new List <string>();
            string        LStrVerificationCode104 = string.Empty;

            try
            {
                if (IDataRowCurrentFocused == null)
                {
                    return;
                }

                LStrVerificationCode104 = App.CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M104);
                string LStrSkillCode = IDataRowCurrentFocused["C006"].ToString();
                LStrSkillCode = EncryptionAndDecryption.EncryptDecryptString(LStrSkillCode, LStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                if (MessageBox.Show(string.Format(App.GetDisplayCharater("S1100015"), LStrSkillCode), App.GClassSessionInfo.AppName, MessageBoxButton.YesNo, MessageBoxImage.Question, MessageBoxResult.No) != MessageBoxResult.Yes)
                {
                    return;
                }
                IStrCurrentMethod = "D";

                LListStrWcfArgs.Add(App.GClassSessionInfo.DatabaseInfo.TypeID.ToString());                                //0
                LListStrWcfArgs.Add(App.GClassSessionInfo.DatabaseInfo.GetConnectionString());                            //1
                LListStrWcfArgs.Add(App.GClassSessionInfo.RentInfo.Token);                                                //2
                LListStrWcfArgs.Add("2");                                                                                 //3
                LListStrWcfArgs.Add(IDataRowCurrentFocused["C001"].ToString());                                           //4
                LListStrWcfArgs.Add("");                                                                                  //5
                LListStrWcfArgs.Add(LStrSkillCode);                                                                       //6
                LListStrWcfArgs.Add(App.GClassSessionInfo.UserID.ToString());                                             //7
                LListStrWcfArgs.Add("");                                                                                  //8
                LListStrWcfArgs.Add("");                                                                                  //9
                LListStrWcfArgs.Add(IDataRowCurrentFocused["C002"].ToString());                                           //10
                LListStrWcfArgs.Add("");                                                                                  //11
                LListStrWcfArgs.Add(IStrCurrentMethod);                                                                   //12

                WebRequest LWebRequestClientLoading = new WebRequest();
                LWebRequestClientLoading.Code = 12111;
                WebReturn LWebReturn = App.SendNetPipeMessage(LWebRequestClientLoading);
                IBoolIsBusy = true;

                IBWSaveData = new BackgroundWorker();
                IBWSaveData.RunWorkerCompleted += IBWSaveData_RunWorkerCompleted;
                IBWSaveData.DoWork             += IBWSaveData_DoWork;
                IBWSaveData.RunWorkerAsync(LListStrWcfArgs);
            }
            catch (Exception ex)
            {
                IBoolIsBusy = false;
                WebRequest LWebRequestClientLoading = new WebRequest();
                LWebRequestClientLoading.Code = 12112;
                WebReturn LWebReturn = App.SendNetPipeMessage(LWebRequestClientLoading);
                if (IBWSaveData != null)
                {
                    IBWSaveData.Dispose(); IBWSaveData = null;
                }
                MessageBox.Show(ex.ToString());
            }
        }
Exemplo n.º 29
0
        public void ShowType212LeftSubObjects()
        {
            string LStrIconPngName   = string.Empty;
            string LStrServerData001 = string.Empty;
            string LStrServerData011 = string.Empty;
            string LStrServerData012 = string.Empty;
            string LStrServerData013 = string.Empty;
            string LStrServerData014 = string.Empty;
            string LStrServerData015 = string.Empty;
            string LStrServerData016 = string.Empty;
            string LStrServerData017 = string.Empty;
            string LStrServerData018 = string.Empty;

            try
            {
                DataRow[] LDataRowCurrentLevelType = App.IDataTable00010.Select("C001 = 212");
                LStrIconPngName = LDataRowCurrentLevelType[0]["C005"].ToString();
                foreach (TreeViewItem LTreeViewItemSingleResurce in TreeViewResourceList.Items)
                {
                    if (LTreeViewItemSingleResurce.DataContext.ToString() != "212")
                    {
                        continue;
                    }
                    CheckAndInitType212Data();
                    LTreeViewItemSingleResurce.Items.Clear();

                    DataRow[] LDataRowDECServer = App.IListDataSetReturn[1].Tables[0].Select("C001 >= 2120000000000000001 AND C001 < 2130000000000000000 AND C011 = '1'", "C012 ASC");
                    foreach (DataRow LDataRowSingleDecServer in LDataRowDECServer)
                    {
                        LStrServerData001 = LDataRowSingleDecServer["C001"].ToString();
                        LStrServerData011 = LDataRowSingleDecServer["C011"].ToString();
                        LStrServerData012 = LDataRowSingleDecServer["C012"].ToString();
                        LStrServerData013 = LDataRowSingleDecServer["C013"].ToString();
                        LStrServerData014 = LDataRowSingleDecServer["C014"].ToString();
                        LStrServerData014 = EncryptionAndDecryption.EncryptDecryptString(LStrServerData014, IStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        LStrServerData015 = LDataRowSingleDecServer["C015"].ToString();
                        LStrServerData015 = EncryptionAndDecryption.EncryptDecryptString(LStrServerData015, IStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        LStrServerData016 = LDataRowSingleDecServer["C016"].ToString();
                        LStrServerData016 = EncryptionAndDecryption.EncryptDecryptString(LStrServerData016, IStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);

                        LStrServerData017 = LDataRowSingleDecServer["C017"].ToString();
                        LStrServerData017 = EncryptionAndDecryption.EncryptDecryptString(LStrServerData017, IStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);
                        LStrServerData018 = LDataRowSingleDecServer["C018"].ToString();
                        LStrServerData018 = EncryptionAndDecryption.EncryptDecryptString(LStrServerData018, IStrVerificationCode104, EncryptionAndDecryption.UMPKeyAndIVType.M104);

                        TreeViewItem LTreeViewItemDECServer = new TreeViewItem();

                        LTreeViewItemDECServer.Header      = LStrServerData017;
                        LTreeViewItemDECServer.DataContext = LStrServerData001;
                        TreeViewItemProps.SetItemImageName(LTreeViewItemDECServer, IStrImageFolder + @"\" + LStrIconPngName);
                        LTreeViewItemSingleResurce.Items.Add(LTreeViewItemDECServer);
                    }
                    LTreeViewItemSingleResurce.IsExpanded = true;
                    break;
                }
            }
            catch (Exception ex) { MessageBox.Show(ex.ToString()); }
        }
Exemplo n.º 30
0
        private void Button_Click_4(object sender, RoutedEventArgs e)
        {
            string LStrSendMessage         = string.Empty;
            string LStrReadMessage         = string.Empty;
            string LStrVerificationCode004 = string.Empty;

            TcpClient LTcpClient = null;
            SslStream LSslStream = null;


            try
            {
                /// <summary>
                ///
                /// </summary>
                /// <param name="AStrArrayConditons">
                /// 0-操作码
                /// 1-媒体类型 1,2
                /// 2-月份 YYYYMM
                /// 3-机器名
                /// 4-IP地址列表  IP+ CHAR(30) + IP .....
                /// </param>
                LStrVerificationCode004 = CreateVerificationCode(EncryptionAndDecryption.UMPKeyAndIVType.M004);

                LStrSendMessage  = EncryptionAndDecryption.EncryptDecryptString("M01E01", LStrVerificationCode004, EncryptionAndDecryption.UMPKeyAndIVType.M004); //0
                LStrSendMessage += AscCodeToChr(27) + "1";                                                                                                        //1
                LStrSendMessage += AscCodeToChr(27) + "201501";                                                                                                   //2
                LStrSendMessage += AscCodeToChr(27) + "MachineName";                                                                                              //3
                LStrSendMessage += AscCodeToChr(27) + "192.168.4.14" + AscCodeToChr(30) + "192.168.4.10";                                                         //4



                LTcpClient = new TcpClient("127.0.0.1", 8080);
                LSslStream = new SslStream(LTcpClient.GetStream(), false, new RemoteCertificateValidationCallback(ValidateServerCertificate), null);
                LSslStream.AuthenticateAsClient("VoiceCyber.PF", null, SslProtocols.Tls, false);
                byte[] LByteMesssage = Encoding.UTF8.GetBytes(LStrSendMessage + "\r\n");
                LSslStream.Write(LByteMesssage); LSslStream.Flush();
                ReadMessageFromServer(LSslStream, ref LStrReadMessage);
                MessageBox.Show(LStrReadMessage);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                if (LSslStream != null)
                {
                    LSslStream.Close();
                }
                if (LTcpClient != null)
                {
                    LTcpClient.Close();
                }
            }
        }