惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Help Net Security
Help Net Security
P
Proofpoint News Feed
J
Java Code Geeks
爱范儿
爱范儿
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
F
Full Disclosure
Google DeepMind News
Google DeepMind News
H
Help Net Security
G
Google Developers Blog
Jina AI
Jina AI
Vercel News
Vercel News
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
L
Lohrmann on Cybersecurity
S
Schneier on Security
Microsoft Azure Blog
Microsoft Azure Blog
IT之家
IT之家
Security Archives - TechRepublic
Security Archives - TechRepublic
阮一峰的网络日志
阮一峰的网络日志
N
News and Events Feed by Topic
GbyAI
GbyAI
B
Blog
O
OpenAI News
博客园_首页
Cisco Talos Blog
Cisco Talos Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News: Ask HN
Hacker News: Ask HN
TaoSecurity Blog
TaoSecurity Blog
腾讯CDC
MongoDB | Blog
MongoDB | Blog
M
MIT News - Artificial intelligence
C
Cybersecurity and Infrastructure Security Agency CISA
Cyberwarzone
Cyberwarzone
Webroot Blog
Webroot Blog
Simon Willison's Weblog
Simon Willison's Weblog
Y
Y Combinator Blog
C
Cisco Blogs
A
Arctic Wolf
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Exploit Database - CXSecurity.com
Security Latest
Security Latest
AI
AI
W
WeLiveSecurity
aimingoo的专栏
aimingoo的专栏
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
Netflix TechBlog - Medium
Blog — PlanetScale
Blog — PlanetScale

博客园 - Louis.Lu.Sz

在C#中,如果声明字段时不加关键字volatile,会影响多线程环境中对该字段的访问吗? Win10, Win11 Ping不通 FastReport使用笔记 Windows窗体控件库的小秘密 在windows桌面显示IP等信息的小工具分享 oracle,根据查询结果结构创建新表 Oracle多表关联如何更新多个字段 我想实现一个通用的配置读写类 【转】Android程序右上角不显示3个点的菜单 Visual studio项目调试时提示“ 你正在调试XXXX的发布版本。” 【原】记录一下第一次使用Python简单处理Excel 【原创】分享一种WPF列表数据的分页打印方案 [原创] 分享一种Asp.NetMVC WebApi作为后端技术结合Vue前端框架开发时开发环境的优雅配置方案 [原] c# winform controls 查找指定类型子控件的扩展方法 [转]Errors while building APK. You can find the errors in the 'Messages' view.解决办法 [转]oracle数据库转mysql数据库 算法:把一个数字拆分成指定数字的和,允许数字个数为0和重复 WPF简单实现可以左右滑动的CheckBox复选框,样式模仿的微信 WPF里借助附加属性让DataGrid显示行号
SaveFileDialog下载模板文件
Louis.Lu.Sz · 2020-06-04 · via 博客园 - Louis.Lu.Sz
var saveDialog = new SaveFileDialog();
            saveDialog.Title = "下载模板";
            //设置文件类型  
            saveDialog.Filter = "Excel工作簿|*.xlsx";
            saveDialog.DefaultExt = "*.xlsx";
            //设置文件名称:
            saveDialog.FileName = "模板.xlsx";
            //保存对话框是否记忆上次打开的目录  
            saveDialog.RestoreDirectory = true;

            var dialogResult = saveDialog.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                var templateFile = Application.StartupPath.Trim() + @"\templates\模板.xlsx";
                //检查模板Excel不存在
                if (!File.Exists(templateFile))
                {
                    MessageBox.Show("模板Excel不存在!请确保文件安装目录" + Application.StartupPath.Trim() + "下的templates文件夹里的模板.xlsx文件存在!");
                    return;
                }
                //如果选择保存的文件路径是模板文件,则禁止保存
                if (saveDialog.FileName == templateFile)
                {
                    MessageBox.Show("请不要选择模板Excel作为导出文件!");
                    return;
                }

                try
                {
                    File.Copy(templateFile, saveDialog.FileName, true);

                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "下载模板出错");
                }

            }