c# - 下载文件并通过 FolderbrowserDialog 选择其位置
解决方案
具体来说:
if(result == DialogResult.OK)
{
openFileName = openFileDialog1.FileName;
try
{
// Output the requested file in richTextBox1.
Stream s = openFileDialog1.OpenFile();
richTextBox1.LoadFile(s, RichTextBoxStreamType.RichText);
s.Close();
fileOpened = true;
}
catch(Exception exp)
{
MessageBox.Show("An error occurred while attempting to load the file. The error is:"
+ System.Environment.NewLine + exp.ToString() + System.Environment.NewLine);
fileOpened = false;
}
推荐阅读
- sql - 连接多个 SQL 结果表
- google-apps-script - Google Apps 脚本 - 从工作表底部上升到可用值
- python - Windows 10上的opencv python相机权限问题
- output - 如何获取 MSTest 测试用例的错误消息。我浏览并找到了以下代码,但字段被分配了空值
- django - Django 模型和 Celery 周期性任务
- arrays - R中的多维数据结构管理
- java - 在 Java 的调用者中反映对变量的更改
- qt - QtQuick 的 ListView 无法获得 QAbstractItemModel 对象的所有权
- angular - 如何在 Angular 中全局声明对象数组
- web-crawler - 在本地模式下运行storm crawler,不依赖zookeeper,nimbus