예제 #1
0
        /// <summary>
        ///
        /// </summary>
        private void DownloadTemplate()
        {
            int                 handle          = this.tileView1.FocusedRowHandle;
            DataRow             drhandle        = this.tileView1.GetDataRow(handle);
            FolderBrowserDialog saveFileDialog1 = new FolderBrowserDialog();
            //saveFileDialog1.Title = "另存为";
            DialogResult rdr      = saveFileDialog1.ShowDialog();
            string       fileName = saveFileDialog1.SelectedPath;

            if (rdr == System.Windows.Forms.DialogResult.OK && !string.IsNullOrEmpty(fileName))
            {
                DataRow dr2      = DocService.Getrealdr(drhandle["task_template_id"].ToString());
                byte[]  decBytes = Convert.FromBase64String(dr2["task_template_file"].ToString());
                //string str2 = Convert.ToBase64String(decBytes);
                fileName = fileName + "\\" + dr2["task_template_file_name"].ToString();
                FileBinaryConvertHelper.Bytes2File(decBytes, fileName);
                MessageBox.Show("保存成功!", "提示");
                RefrashGridcontrol();
            }
        }