Ejemplo n.º 1
0
        private void btnAtualizacao_Click(object sender, EventArgs e)
        {
            string        sVersao = Assembly.GetEntryAssembly().GetName().Version.ToString();
            DirectoryInfo dinfo   = new DirectoryInfo(@"G:\CSharp\Desenvolvimento");
            DirectoryInfo dinfo2  = new DirectoryInfo(@"J:\D6\Industri");

            string sUrl = "";

            if ((dinfo.Exists) && (dinfo.Exists))
            {
                sUrl = "http://192.168.9.33:8081/Suporte/DownloadGeraXml.aspx?Versao=";
            }
            else
            {
                sUrl = "hlpsistemas.no-ip.org:8081/Suporte/DownloadGeraXml.aspx?Versao=" + sVersao;
            }


            bool ok = false;

            foreach (Form frm in this.MdiChildren)
            {
                if (frm is frmDownloadVersao)
                {
                    frm.BringToFront();
                    ok = true;
                }
            }
            if (!ok)
            {
                frmDownloadVersao objfrm = new frmDownloadVersao(sUrl);
                this.AddOwnedForm(objfrm);
                objfrm.MdiParent = this;
                this.splitContainerTela.Panel2.Controls.Add(objfrm);
                objfrm.WindowState = FormWindowState.Normal;
                objfrm.Dock        = DockStyle.Fill;
                objfrm.Show();
                objfrm.BringToFront();
            }
        }
Ejemplo n.º 2
0
        private void btnAtualizacao_Click(object sender, EventArgs e)
        {
            string sVersao = Assembly.GetEntryAssembly().GetName().Version.ToString();
            DirectoryInfo dinfo = new DirectoryInfo(@"G:\CSharp\Desenvolvimento");
            DirectoryInfo dinfo2 = new DirectoryInfo(@"J:\D6\Industri");

            string sUrl = "";

            if ((dinfo.Exists) && (dinfo.Exists))
            {
                sUrl = "http://192.168.9.33:8081/Suporte/DownloadGeraXml.aspx?Versao=";
            }
            else
            {
                sUrl = "hlpsistemas.no-ip.org:8081/Suporte/DownloadGeraXml.aspx?Versao=" + sVersao;
            }


            bool ok = false;

            foreach (Form frm in this.MdiChildren)
            {
                if (frm is frmDownloadVersao)
                {
                    frm.BringToFront();
                    ok = true;
                }
            }
            if (!ok)
            {
                frmDownloadVersao objfrm = new frmDownloadVersao(sUrl);
                this.AddOwnedForm(objfrm);
                objfrm.MdiParent = this;
                this.splitContainerTela.Panel2.Controls.Add(objfrm);
                objfrm.WindowState = FormWindowState.Normal;
                objfrm.Dock = DockStyle.Fill;
                objfrm.Show();
                objfrm.BringToFront();
            }
        }