Click here to Skip to main content
15,910,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
how can Setvalue something like this :-
 
mykey.SetValue("MaximumAttachmentSize","REG_DWORD","51200");
 
mykey.SetValue(Name,Type,Data)



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();
Posted
Updated 16-May-16 22:50pm
Comments
Mehdi Gholam 17-May-16 3:14am    
ASP.net is a server side technology, the registry key will not be set on the client (if you want to change the office configuration for the user).

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[^].
 
Share this answer
 
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)[^]
 
Share this answer
 
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 ?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900