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. input输入框的border-radius属性在IE8下的完美兼容

    在工作中我们发现搜索框大部分都是有圆角的,为此作为经验不足的前端人员很容易就想到,给input标签添加border-radius属性不就解决了嘛.不错方法确实是这样,但是不要忘了border-radi ...

  2. 《深入浅出JavaScript》

    第一章JS入门 第二章数据和判定常用的转义序列\b 回退 \f换页 \n换行 \r回车 \t制表符 \'单引 \"双引 \\反斜乘除求余的优先级相同,从左向右执行string对象indexO ...

  3. setTimeout(f, 0)的应用&利用Deferred实现队列运行

    任务:从mongodb中导出csv数据,输出内容如下userid username usergender points points表: { "userid" : 1022, &q ...

  4. Light OJ 1364 Expected Cards (期望dp,好题)

    题目自己看吧,不想赘述. 参考链接:http://www.cnblogs.com/jianglangcaijin/archive/2013/01/02/2842389.html #include &l ...

  5. 【C语言】二维数组做形参

    二维数组有两种形式: ①在栈上:         int a[4][4] = {...}; ②在堆堆上:          int ** a = new int *[4];           for ...

  6. hdu 4722 Good Numbers 数位DP

    数位DP!!! 代码如下: #include<iostream> #include<stdio.h> #include<algorithm> #include< ...

  7. poj 3613(经过N条边的最短路)

    题目链接:http://poj.org/problem?id=3613 思路:我们知道如果矩阵A表示经过1条边的方案数,那么A^N矩阵就代表这经过N条边的方案数,而本题中要求经过N条边的最短距离,于是 ...

  8. mysql变量使用总结

    set语句的学习: 使用select定义用户变量的实践将如下语句改成select的形式: set @VAR=(select sum(amount) from penalties);我的修改: sele ...

  9. netbeans使用

    下载地址 https://netbeans.org/downloads/ https://netbeans.org/downloads/start.html?platform=linux&la ...

  10. mq_getattr

    NAME mq_getattr - 获取消息队列的属性(REALTIME) SYNOPSIS #include <mqueue.h> int mq_getattr(mqd_t mqdes, ...