Пример #1
0
        /// <summary>
        /// 确定上传文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var uploadFiles = MemexUpateHelper.GetFiles(txtBoxLoadPath.Text);

            progressBar1.Maximum = uploadFiles.FileCount;
            progressBar1.Value   = 0;
            progressBar1.Visible = true;
            label4.Visible       = true;
            richTextBox1.Text   += "开始上传,项目名称:" + textBox3.Text + ", 版本号:" + txtBoxProjectVersion.Text + "\n";

            if (uploadFiles != null && uploadFiles.MDir != null && uploadFiles.FileCount > 0)
            {
                MemexUpateHelper.DeleteAppInfo(textBox3.Text);

                MemexUpateHelper.DeleteFile(textBox3.Text);

                MemexUpateHelper.WriteLog(string.Format("开始上传项目:{0},版本号{1},项目路径:{2}", textBox3.Text, txtBoxProjectVersion.Text, txtBoxLoadPath.Text), true);

                StartUploadFile(uploadFiles.MDir);
                MemexUpateHelper.WriteLog(string.Format("上传项目{0} 结束", textBox3.Text), true);
                var appParams = new ApplicationInfo {
                    AppName = textBox3.Text, AppVersion = txtBoxProjectVersion.Text, AppPath = txtBoxLoadPath.Text
                };

                //设置刚上传的项目信息时应该先更新IIS内存中项目信息列表
                GetFilesFromTxtForce();

                MemexUpateHelper.SetApplicationInfo(appParams);
                //更新项目文件信息到XML中
                MemexUpateHelper.UpdateAppInfo(textBox3.Text);

                GetFilesFromTxtForce();

                progressBar1.Visible = false;
                label4.Visible       = false;
                richTextBox1.Text   += "上传完成,项目名称:" + textBox3.Text + ", 版本号:" + txtBoxProjectVersion.Text + "\n";
                MessageBox.Show("上传完成!");
            }
        }
Пример #2
0
        /// <summary>
        /// 确定上传文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnConfirm_Click(object sender, EventArgs e)
        {
            var uploadFiles = MemexUpateHelper.GetFiles(txtBoxLoadPath.Text);

            if (uploadFiles != null && uploadFiles.MDir != null && uploadFiles.FileCount > 0)
            {
                MemexUpateHelper.DeleteAppInfo(textBox3.Text);
                MemexUpateHelper.DeleteFile(textBox3.Text);
                StartUploadFile(uploadFiles.MDir);
                var appParams = new ApplicationInfo {
                    AppName = textBox3.Text, AppVersion = txtBoxProjectVersion.Text, AppPath = txtBoxLoadPath.Text
                };
                MemexUpateHelper.SetApplicationInfo(appParams);
                GetFileList();
                //更新项目文件信息到XML中
                MemexUpateHelper.UpdateAppInfo(textBox3.Text);
                MessageBox.Show("上传完成!");
            }
            else
            {
                MessageBox.Show("选择的文件夹没有文件!");
            }
        }