简体   繁体   English

从C#调用操作系统设置

[英]Calling OS settings from C#

For my program, I would like to click a button and have the user be able to access certain settings of their computer. 对于我的程序,我想单击一个按钮并使用户能够访问其计算机的某些设置。

I have no idea about how to access the OS at all. 我根本不知道如何访问操作系统。 Other questions assume that the readers have a basic understanding of this . 其他问题假定读者对此有基本的了解。 I have none and need someone to give me a link or a full explanation on how to do this and why there answer works. 我没有任何人,需要有人给我一个链接或完整的解释,说明如何执行此操作以及为什么回答有效。

So if they select Date Settings Buttons I will like the following Window to show: 因此,如果他们选择“日期设置”按钮,我将显示以下窗口: 在此处输入图片说明

I have no idea how to get certain settings to show. 我不知道如何显示某些设置。 Any help would be welcomed 任何帮助都将受到欢迎

How to open various Settings pages directly in Windows 10 describes the commands to open settings with the run console. 如何直接在Windows 10打开各种“设置”页面,介绍了使用运行控制台打开设置的命令。

Battery Saver --> ms-settings:batterysaver 省电模式-> ms-settings:batterysaver

Battery Saver Settings --> ms-settings:batterysaver-settings 省电设定-> ms-settings:batterysaver-settings

... ...

Use such a command with the Process.Start-Method and open the required settings. 将此类命令与Process.Start-Method一起使用,然后打开所需的设置。 For example the Windows update settings will open with 例如,Windows更新设置将以

System.Diagnostics.Process.Start("ms-settings:windowsupdate");

or the requested date settings with 或使用

System.Diagnostics.Process.Start("ms-settings:dateandtime");

你需要:

System.Diagnostics.Process.Start("ms-settings:dateandtime");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM