gpt4 book ai didi

c# - 使用 Process.Start 在 C# 中打开文件

转载 作者:行者123 更新时间:2023-11-30 13:13:39 30 4
gpt4 key购买 nike

我正在编写一个程序来监视文件夹并在文件创建时通知您。当用户单击“确定”时,我很难打开文件。请给我关于如何让 Process.Start() 工作的建议,我正在尝试获取文件位置以从 e.Fullpath 加载文本文件并在记事本中打开。

private void fileSystemWatcher1_Changed(object sender, FileSystemEventArgs e)
{
DialogResult messageresult = MessageBox.Show("You have a Collection Form: " + e.Name);
if (messageresult == DialogResult.OK)
Process.Start("Notepad.exe", "e.FullPath");
}

最佳答案

尝试 Process.Start("Notepad.exe", e.FullPath);

关于c# - 使用 Process.Start 在 C# 中打开文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5592590/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com