Ejemplo n.º 1
0
        private async void WinFormTongzhi_Load(object sender, EventArgs e)
        {
            //下载到临时文件,然后加载到richtextbox
            await JJMethod.DownLoadFileAsync(myinfo._neirongpath, ".\\temp.rtf");

            richTextBox1.LoadFile(".\\temp.rtf");
            //获得标题下所有人员,获得已读和未读人员,刷新未读panel

            UpdatePanelWeidu();
        }
Ejemplo n.º 2
0
        private async void btn_xiazai_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog sfd = new SaveFileDialog();
                sfd.Filter = "Excel 97~2003工作簿|*.xls|Excel 工作簿|*.xlsx";

                if (sfd.ShowDialog() == DialogResult.OK)
                {
                    string filename = "http://49.233.40.109/标准表格.xlsx";
                    await JJMethod.DownLoadFileAsync(filename, sfd.FileName);

                    MessageBox.Show("表格下载成功!");
                }
            }
            catch (Exception ex) { string aa = ex.Message; }
        }
Ejemplo n.º 3
0
        private async void lbl_xiazai_Click(object sender, EventArgs e)
        {
            SaveFileDialog sfd = new SaveFileDialog();

            sfd.Filter   = "Excel 97-2003工作簿|*.xls|Excel 工作簿|*.xlsx|压缩文件(ZIP)|*.zip";
            sfd.FileName = Path.GetFileName(_myinfo._quanlujing);
            if (Path.GetExtension(_myinfo._quanlujing).Equals(".xls"))
            {
                sfd.Filter = "Excel 97-2003工作簿|*.xls";
            }
            if (Path.GetExtension(_myinfo._quanlujing).Equals(".xlsx"))
            {
                sfd.Filter = "Excel 工作簿|*.xlsx";
            }
            if (Path.GetExtension(_myinfo._quanlujing).Equals(".zip"))
            {
                sfd.Filter = "压缩文件(ZIP)|*.zip";
            }
            if (Path.GetExtension(_myinfo._quanlujing).Equals(".doc"))
            {
                sfd.Filter = "Word 97-2003文档|*.doc";
            }
            if (Path.GetExtension(_myinfo._quanlujing).Equals(".docx"))
            {
                sfd.Filter = "Word 文档|*.docx";
            }
            if (Path.GetExtension(_myinfo._quanlujing).Equals(".txt"))
            {
                sfd.Filter = "文本文件TXT|*.txt";
            }



            if (sfd.ShowDialog() == DialogResult.OK)
            {
                lbl_info.Visible = true;
                lbl_info.Text    = "正在下载……";
                await JJMethod.DownLoadFileAsync(_myinfo._quanlujing, sfd.FileName);

                lbl_info.Visible = false;

                MessageBox.Show("下载完成!");
            }
        }