c# - C# 中的 Powerpoint 加载项应用程序,需要访问演示文稿所有者详细信息
问题描述
我必须在 c# 中编写一个可以连接到 OneDrive 的 Powerpoint 加载项应用程序,然后从 OneDrive 上传文件和检索文件,我还需要获取演示文稿所有者详细信息和共享详细信息(其他用户权限,可以编辑或只读)。我检查了系统环境变量,但在我的机器上找不到任何东西。如何以编程方式执行此操作?我在网上搜索过,但我找不到任何东西。请帮我解决这种类型的要求..?
解决方案
您可以尝试使用 OpenFileDialog 和 SaveFileDialog 来读取/写入您的 Powerpoint 文件
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
openFileDialog.InitialDirectory = "OneDrive";
openFileDialog.Filter = "pptx files (*.pptx)|*.pptx|All files (*.*)|*.*";
openFileDialog.FilterIndex = 2;
openFileDialog.RestoreDirectory = true;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
//Read the contents of the file into a stream
var fileStream = openFileDialog.OpenFile();
// Do your stuff
}
}
推荐阅读
- bash - 在以下情况下,/bin/bash $0 $0 在第 5 行做什么?
- python - 有概率的简单突变
- c# - Entity Framework C# Table 未使用 add 方法更新数据
- sql-server - 如何按月划分金额和订单?sql服务器
- c++ - 输入数据的时间复杂度
- python - TensorFlow 2.x:无法以 h5 格式保存训练模型(OSError:无法创建链接(名称已存在))
- c# - HttpClient Polly 超时策略
- python - {Discord.py-rewrite} Bot 命令在我有“On Message”事件时不起作用
- javascript - 比较两个数组对象的匹配数据并返回新的数组对象
- amazon-web-services - 如何将 Kinesis 流中的分片分配给 Kinesis 使用者的多个实例?