使用Process.Start()打开.msg文件 [英] open .msg file using Process.Start()

查看:124
本文介绍了使用Process.Start()打开.msg文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ProcessStartInfo startInfo = new ProcessStartInfo();
Process first = new Process();   
startInfo.FileName = "OUTLOOK";
                    startInfo.Arguments = "http:\\blabla.com\EMAIL.msg";
                    startInfo.CreateNoWindow = true;                        
                    first.StartInfo = startInfo;
                    first.Start();

我使用Process.Start来启动Outlook并打开一个.Msg文件.如何在不打开Outlook的多个进程/线程/实例的情况下重复使用同一进程来打开另一个.msg文件?

i used Process.Start to start up Outlook and open a .Msg file. how can i reuse the same process to open another .msg file without opening multiple processes/threads/instances of outlook?

我尝试过类似

Process[] outlook = Process.GetProcessesByName("OUTLOOK");
Process existing = outlook[0];
                    startInfo.FileName = "outlook";
                    startInfo.Arguments = "http:\\blabla.com\2ndEMAIL.msg";
                    startInfo.CreateNoWindow = true;
                    existing.StartInfo = startInfo;
                    existing.Start();                         

要重用相同的过程,但我仍在打开多个Outlook窗口,而不仅仅是.MSG文件

to reuse the same process but i'm still opening multiple windows of outlook instead of just the .MSG file it

推荐答案

做到这一点

var process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo
{
  FileName = fullPath //path of msg file
};
process.StartInfo = startInfo;
process.Start();

这篇关于使用Process.Start()打开.msg文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆