如何使用.net在Windows 7中设置标准电子邮件客户端
本文关键字:设置 标准 电子邮件 客户端 何使用 net Windows | 更新日期: 2023-09-27 18:11:54
我想从。net代码中设置Windows 7中的标准电子邮件客户端,我该怎么做?
您需要编辑以下注册表值。您可以对注册表执行如下操作。SetValue方法。
Registry.SetValue(@"HKEY_CLASSES_ROOT'mailto'shell'open'command", "", "'"C:''PROGRA~2''MICROS~1''Office14''OUTLOOK.EXE'" -c IPM.Note /m '"%1'"");
Reference:
http://msdn.microsoft.com/en-us/library/3dwk5axy.aspx
You can find the default email program with the following Registry Key. Find it's content and mess with it:
Check the following link here at SO:
Find default email client
using System;
using Microsoft.Win32;
namespace RegistryTestApp
{
class Program
{
static void Main(string[] args)
{
object mailClient = Registry.GetValue(@"HKEY_LOCAL_MACHINE'SOFTWARE'Clients'Mail", "", "none");
Console.WriteLine(mailClient.ToString());
}
}
}