如何使用C#编写系统注册表项 [英] How to write system registry keys using C#

查看:87
本文介绍了如何使用C#编写系统注册表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how can Setvalue something like this :-
 
mykey.SetValue("MaximumAttachmentSize","REG_DWORD","51200");
 
mykey.SetValue(Name,Type,Data)







please帮帮我



我的尝试:



Microsoft.Win32。 RegistryKey mykey;

mykey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@SOFTWARE\Microsoft\Office\15.0\Outlook\Preferences);

mykey.SetValue(MaximumAttachmentSize,51200);

mykey.Close();




please help me

What I have tried:

Microsoft.Win32.RegistryKey mykey;
mykey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"SOFTWARE\Microsoft\Office\15.0\Outlook\Preferences");
mykey.SetValue("MaximumAttachmentSize","51200");
mykey.Close();

推荐答案

Google 是你的朋友。关于这个论点有许多可用的教程,文章和答案。例如,请参阅在C#应用程序中写入注册表 - Stack Overflow [ ^ ] 。
Google is your friend. There are many available tutorials, articles and answers on the argument. See, for instance Writing to registry in a C# application - Stack Overflow[^].


如果您尝试在客户端上执行此操作,则不能。如果您尝试在服务器上执行它是没有意义的,因为您不应该自动化Outlook,它不受支持且无法工作。如果你想发送电子邮件,请使用



MailMessage类(System.Net.Mail) [ ^ ]
If you're trying to do this on the client you can't. If you're trying to do it on the server it is pointless as you shouldn't be automating Outlook, it isn't supported and isn't going to work. If you want to send emails use

MailMessage Class (System.Net.Mail)[^]


ASp.NET仅处理服务器,它无法将注册表项设置为客户端计算机,是否要在服务器或客户端上设置?

请指定?
ASp.NET deal with server only, it can not set the registry key to client machine, do you want to set it on server or on client ?
Please specify ?


这篇关于如何使用C#编写系统注册表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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