コード例 #1
0
        private void createClientFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (OpenClientFile.ShowDialog(this) == DialogResult.OK)
            {
                List <string> archs = new List <string>();
                List <string> apps  = new List <string>();
                SortedList <string, string> vers = new SortedList <string, string>();

                foreach (string s in UpdateArchitecture.Items)
                {
                    archs.Add(s);
                }
                foreach (string s in UpdateApplication.Items)
                {
                    apps.Add(s);
                }

                Version v = new Version();
                foreach (Update u in listBox1.Items)
                {
                    if (u.Version > v)
                    {
                        v = u.Version;
                    }
                    vers[u.VersionString.ToLower()] = u.VersionString;
                }

                System.Security.Cryptography.RSA cp = System.Security.Cryptography.RSACryptoServiceProvider.Create();
                cp.FromXmlString(m_privateKey);
                string pubkey = cp.ToXmlString(false);

                ClientFileEditor cfe = new ClientFileEditor();
                cfe.Setup(OpenClientFile.FileName, apps, archs, new List <string>(vers.Values), v, pubkey);
            }
        }
コード例 #2
0
        private void createClientFileToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (OpenClientFile.ShowDialog(this) == DialogResult.OK)
            {
                List<string> archs = new List<string>();
                List<string> apps = new List<string>();
                SortedList<string, string> vers = new SortedList<string, string>();

                foreach (string s in UpdateArchitecture.Items)
                    archs.Add(s);
                foreach (string s in UpdateApplication.Items)
                    apps.Add(s);

                Version v = new Version();
                foreach (Update u in listBox1.Items)
                {
                    if (u.Version > v)
                        v = u.Version;
                    vers[u.VersionString.ToLower()] = u.VersionString;
                }

                System.Security.Cryptography.RSA cp = System.Security.Cryptography.RSACryptoServiceProvider.Create();
                cp.FromXmlString(m_privateKey);
                string pubkey = cp.ToXmlString(false);

                ClientFileEditor cfe = new ClientFileEditor();
                cfe.Setup(OpenClientFile.FileName, apps, archs, new List<string>(vers.Values), v, pubkey);
            }
        }