using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.IO; namespace DOS工具箱
{
public class 调用系统资源
{
//引入API函数
[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=;//API参数表示隐藏窗口
private const int SW_SHOW=;//API参数表示用当前的大小和位置显示窗口 public static void 弹出光驱()
{
mciSendString("set CDAudio door open", null, , );
} public static void 关闭光驱()
{
mciSendString("set CDAudio door closed", null, , );
} public static void 打开C盘()
{
Process.Start("c:\\");
} public static void 打开D盘()
{
Process.Start("d:\\");
} public static void 打开E盘()
{
Process.Start("e:\\");
} public static void 打开F盘()
{
Process.Start("f:\\");
} public static void 打开指定盘(string hardpath)
{
Process.Start(hardpath);
} public static void 打开Word()
{
Process.Start(@"C:\Program Files\Microsoft Office\OFFICE11\winword.exe");
} public static void 打开Excel()
{
Process.Start(@"C:\Program Files\Microsoft Office\OFFICE11\excel.exe");
} public static void 打开Access()
{
Process.Start(@"C:\Program Files\Microsoft Office\OFFICE11\msaccess.exe");
} public static void 打开PowerPoint()
{
Process.Start(@"C:\Program Files\Microsoft Office\OFFICE11\powerpnt.exe");
} public static void 打开OutLook()
{
Process.Start(@"C:\Program Files\Microsoft Office\OFFICE11\outlook.exe");
} public static void 打开记事本()
{
Process.Start("notepad.exe");
} public static void 打开计算器()
{
Process.Start("calc.exe");
} public static void 打开DOS命令窗口()
{
Process.Start("cmd.exe");
} public static void 打开注册表()
{
Process.Start("regedit.exe");
} public static void 打开画图板()
{
Process.Start("mspaint.exe");
} public static void 打开写字板()
{
Process.Start("write.exe");
} public static void 打开播放器()
{
Process.Start("mplayer2.exe");
} public static void 打开资源管理器()
{
Process.Start("explorer.exe");
} public static void 打开任务管理器()
{
Process.Start("taskmgr.exe");
} public static void 打开事件查看器()
{
Process.Start("eventvwr.exe");
} public static void 打开系统信息()
{
Process.Start("winmsd.exe");
} public static void 打开备份还原()
{
Process.Start("ntbackup.exe");
} public static void 打开Windows版本()
{
Process.Start("winver.exe");
} public static void 打开控制面板()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL");
} public static void 打开控制面板辅助选项键盘()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL access.cpl,,1");
} public static void 打开控制面板辅助选项声音()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL access.cpl,,2");
} public static void 打开控制面板辅助选项显示()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL access.cpl,,3");
} public static void 打开控制面板辅助选项鼠标()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL access.cpl,,4");
} public static void 打开控制面板辅助选项常规()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL access.cpl,,5");
} public static void 打开控制面板添加新硬件向导()
{
Process.Start("rundll32.exe", "shell32.dll,Control_RunDLL sysdm.cpl @1");
} public static void 打开控制面板添加新打印机向导()
{
Process.Start("rundll32.exe", "shell32.dll,SHHelpShortcuts_RunDLL AddPrinter");
} public static void 打开控制面板添加删除程序安装卸载面板()
{
Process.Start("rundll32.exe", "shell32.dll,shell32.dll,Control_RunDLL appwiz.cpl,,1");
} public static void 打开控制面板添加删除程序安装Windows面板()
{
Process.Start("rundll32.exe", "shell32.dll,shell32.dll,Control_RunDLL appwiz.cpl,,2");
} public static void 打开控制面板添加删除程序启动盘面板()
{
Process.Start("rundll32.exe", "shell32.dll,shell32.dll,Control_RunDLL appwiz.cpl,,3");
} public static void 打开建立快捷方式对话框()
{
Process.Start("rundll32.exe"," appwiz.cpl,NewLinkHere %1");
} public static void 打开日期时间选项()
{
Process.Start("rundll32.exe"," shell32.dll,Control_RunDLL timedate.cpl,,0");
} public static void 打开时区选项()
{
Process.Start("rundll32.exe", " shell32.dll,Control_RunDLL timedate.cpl,,1");
} public static void 建立公文包()
{
Process.Start("rundll32.exe"," syncui.dll,Briefcase_Create");
} public static void 打开复制软碟窗口()
{
Process.Start("rundll32.exe"," diskcopy.dll,DiskCopyRunDll");
} public static void 打开新建拨号连接()
{
Process.Start("rundll32.exe"," rnaui.dll,RnaWizard");
} public static void 打开显示属性背景()
{
Process.Start("rundll32.exe"," shell32.dll,Control_RunDLL desk.cpl,,0");
} public static void 打开显示属性屏幕保护()
{
Process.Start("rundll32.exe", " shell32.dll,Control_RunDLL desk.cpl,,1");
} public static void 打开显示属性外观()
{
Process.Start("rundll32.exe", " shell32.dll,Control_RunDLL desk.cpl,,2");
} public static void 打开显示属性属性()
{
Process.Start("rundll32.exe", " shell32.dll,Control_RunDLL desk.cpl,,3");
}

c#调用系统资源大集合-1的更多相关文章

  1. c#调用系统资源大集合-3

    public static void 打开控制面板多媒体属性音频() { Process.Start("rundll32.exe", " shell32.dll,Cont ...

  2. c#调用系统资源大集合-2

    public static void 打开格式化对话框() { Process.Start("rundll32.exe"," shell32.dll,SHFormatDr ...

  3. 干货!IT小伙伴们实用的网站及工具大集合!持续更新!

    1.Git 还在担心自己辛辛苦苦写的代码被误删了吗?还在担心自己改错了代码不能挽回吗?还在苦恼于多人开发合作找不到一个好的工具吗?那么用Git就对 了,Git是一个开源的分布式版本控制系统,用以有效. ...

  4. Office在线预览及PDF在线预览的实现方式史上最全大集合

    Office在线预览及PDF在线预览的实现方式大集合 一.服务器先转换为PDF,再转换为SWF,最后通过网页加载Flash预览 微软方:利用Office2007以上版本的一个PDF插件SaveAsPD ...

  5. Android 常用代码大集合 [转]

    [Android]调用字符串资源的几种方法   字符串资源的定义 文件路径:res/values/strings.xml 字符串资源定义示例: <?xml version="1.0&q ...

  6. Python GUI之tkinter窗口视窗教程大集合(看这篇就够了) JAVA日志的前世今生 .NET MVC采用SignalR更新在线用户数 C#多线程编程系列(五)- 使用任务并行库 C#多线程编程系列(三)- 线程同步 C#多线程编程系列(二)- 线程基础 C#多线程编程系列(一)- 简介

    Python GUI之tkinter窗口视窗教程大集合(看这篇就够了) 一.前言 由于本篇文章较长,所以下面给出内容目录方便跳转阅读,当然也可以用博客页面最右侧的文章目录导航栏进行跳转查阅. 一.前言 ...

  7. 100多个很有用的JavaScript函数以及基础写法大集合

    100多个很有用的JavaScript函数以及基础写法大集合 1.document.write("");为 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:docume ...

  8. LINUX下编译安装PHP各种报错大集合

    本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. nginx1.6.2-mysql5.5.32二进制,php安装报错解决: 123456 [root@clien ...

  9. 【ASP.NET实战教程】ASP.NET实战教程大集合,各种项目实战集合

    [ASP.NET实战教程]ASP.NET实战教程大集合,各种项目实战集合,希望大家可以好好学习教程中,有的比较老了,但是一直很经典!!!!论坛中很多小伙伴说.net没有实战教程学习,所以小编连夜搜集整 ...

随机推荐

  1. PowerDesigner(三)-企业架构模型(转)

    企业架构模型(Enterprise Architecture Model,EAM)是PowerDesigner 15新增的功能,它能够以图形的方式展现企业架构,从而取代文字描述:以偏向非技术性的表达方 ...

  2. Working with LOBs in Oracle and PHP

    原文链接:http://www.oracle.com/technetwork/articles/fuecks-lobs-095315.html Working with LOBs in Oracle ...

  3. O2O模式成功案例分享 汲取精华化为己用

    本文通过分享一些公司的o2o成功案例让您了解什么是O2O,o2o的优势,o2o模式有哪些,未来我们要如何做o2o才更有竞争力,学牛人的o2o创新玩法,摸索适合自己的o2o思路.拥抱o2o - 传统企业 ...

  4. Javascript引擎单线程机制及setTimeout执行原理说明

    setTimeout用法在实际项目中还是会时常遇到.比如浏览器会聪明的等到一个函数堆栈结束后才改变DOM,如果再这个函数堆栈中把页面背景先从白色设为红色,再设回白色,那么浏览器会认为DOM没有发生任何 ...

  5. Ext Js学习之IIS理解

    站点分为静态网站和动态网站,纯粹利用html编写的网站属于静态网站,不宜维护和更新而利用C#+extjs等前台+后台技术编写的网站就属于动态站点,有更多的交互,易维护和更新,比如降价的页面,利用htm ...

  6. Extjs利用vtype验证表单

    Ext.create('Ext.form.Panel', {         title: '表单验证',         renderTo: Ext.getBody(),         frame ...

  7. cf div2 234 D

    D. Dima and Bacteria time limit per test 2 seconds memory limit per test 256 megabytes input standar ...

  8. Android 核心分析 之五基本空间划分

    基本空间划分 Google给了我们一张系统架构图,在这张图上我们可以看到Android的大体框架组成.                   11.jpg (175.6 KB, 下载次数: 0) 下载附 ...

  9. dojo新建widget步骤----主要针对widget路径

    一,新建目录 二,新建文件 三,写urtil widget代码 四,写RedTextDialog代码 五,写HTML代码 =====================如有不懂,结合http://blog ...

  10. 文件夹属性中只有"常规"解决办法

    Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers] [HK ...