C # calling a large set of system resources-1

Source: Internet
Author: User
First, write a class that calls system resources, Code Using system; using system. collections. generic; using system. text; using system. runtime. interopservices; using system. diagnostics; using system. io; namespace dostoolbox {public class calls system resources {// introduces the API function [dllimportattribute ("user32.dll")] public static extern int findwindow (string classname, string windowname ); [dllimport ("user32.dll")] public static extern int showwindow (INT handle, int cmdshow); [dllimport ("winmm. DLL ", entrypoint =" mcisendstring ", charset = charset. auto)] public static extern int mcisendstring (string lpstrcommand, string lpstrreturnstring, int ureturnlength, int hwndcallback); Private const int sw_hide = 0; // The API parameter indicates the hidden window private const int sw_show = 5; // The API parameter indicates that the public static void dialog box is displayed with the current size and position () {mcisendstring ("set cdaudio door open", null, 127, 0);} public static void disable optical drive () {mcisendstring ("set cdaudio door closed", null, 127, 0);} open drive C () {process. start ("C :\\");} public static void open disk D () {process. start ("d :\\");} public static void open e disk () {process. start ("e :\\");} public static void open F disk () {process. start ("f :\\");} public static void open the specified disk (string hardpath) {process. start (hardpath);} open Word () {process. start (@ "C: \ Program Files \ Microsoft Office \ office11 \ winword.exe");} public static void open Excel () {process. start (@ "C: \ Program Files \ Microsoft Office \ office11 \ excel.exe");} open public static void access () {process. start (@ "C: \ Program Files \ Microsoft Office \ office11 \ msaccess.exe");} public static void open PowerPoint () {process. start (@ "C: \ Program Files \ Microsoft Office \ office11 \ powerpnt.exe");} open outlook () {process. start (@ "C: \ Program Files \ Microsoft Office \ office11 \ outlook.exe");} public static void open notepad () {process. start ("notepad.exe");} public static void open calculator () {process. start ("calc.exe");} public static void open the DOS command window () {process. start ("cmd.exe");} open the Registry () {process. start ("regedit.exe");} public static void open the palette () {process. start ("mspaint.exe");} public static void open the WordPad () {process. start ("write.exe");} open the player () {process. start ("mplayer2.exe");} open Resource Manager () {process. start ("assumer.exe");} public static void open the Task Manager () {process. start ("taskmgr.exe");} public static void open Event Viewer () {process. start ("eventvwr.exe");} public static void Open System Information () {process. start ("winmsd.exe");} public static void open Backup Recovery () {process. start ("ntbackup.exe");} open windows version () {process. start ("winver.exe");} public static void Open Control Panel () {process. start ("rundll32.exe", "shell32.dll, control_rundll");} open the control panel auxiliary option keyboard () {process. start ("rundll32.exe", "shell32.dll, control_rundll access. CPL, 1 ");} public static void Open Control Panel auxiliary option sound () {process. start ("rundll32.exe", "shell32.dll, control_rundll access. CPL, 2 ");} public static void Open Control Panel auxiliary options display () {process. start ("rundll32.exe", "shell32.dll, control_rundll access. CPL, 3 ");} public static void Open Control Panel secondary option mouse () {process. start ("rundll32.exe", "shell32.dll, control_rundll access. CPL, 4 ");} public static void Open Control Panel auxiliary options General () {process. start ("rundll32.exe", "shell32.dll, control_rundll access. CPL, 5 ");} public static void Open Control Panel add new hardware wizard () {process. start ("rundll32.exe", "shell32.dll, control_rundll sysdm. cpl @ 1 ");} public static void Open Control Panel add new printer wizard () {process. start ("rundll32.exe", "shell32.dll, shhelpshortcuts_rundll addprinter");} public static void Open Control Panel add Delete Program Install and uninstall Panel () {process. start ("rundll32.exe", "shell32.dll, shell32.dll, control_rundll appwiz. CPL, 1 ");} public static void Open Control Panel add delete program install Windows panel () {process. start ("rundll32.exe", "shell32.dll, shell32.dll, control_rundll appwiz. CPL, 2 ");} public static void Open Control Panel add and delete program boot disk Panel () {process. start ("rundll32.exe", "shell32.dll, shell32.dll, control_rundll appwiz. CPL, 3 ");} public static void opens the create shortcut dialog box () {process. start ("rundll32.exe", "appwiz. CPL, newlinkhere % 1 ");} public static void open date and time option () {process. start ("rundll32.exe", "shell32.dll, control_rundll TimeDate. CPL, 0 ");} public static void open time zone option () {process. start ("rundll32.exe", "shell32.dll, control_rundll TimeDate. CPL, 1 ");} public static void create a briefcase () {process. start ("rundll32.exe", "syncui. DLL, briefcase_create ");} public static void open the copy disc window () {process. start ("rundll32.exe", "diskcopy. DLL, diskcopyrundll ");} public static void open new dialing connection () {process. start ("rundll32.exe", "rnaui. DLL, rnawizard ");} public static void open display attribute background () {process. start ("rundll32.exe", "shell32.dll, control_rundll desk. CPL, 0 ");} public static void enable display property Screen Protection () {process. start ("rundll32.exe", "shell32.dll, control_rundll desk. CPL, 1 ");} public static void open display attribute appearance () {process. start ("rundll32.exe", "shell32.dll, control_rundll desk. CPL, 2 ");} public static void open display property attribute () {process. start ("rundll32.exe", "shell32.dll, control_rundll desk. CPL, 3 ");} // public static void open the Windows Font folder () // {// process. start ("rundll32.exe", "shell32.dll, shhelpshortcuts_rundll fontsfolder ");//}
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.