c#调用系统资源大集合-1
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的更多相关文章
- c#调用系统资源大集合-3
public static void 打开控制面板多媒体属性音频() { Process.Start("rundll32.exe", " shell32.dll,Cont ...
- c#调用系统资源大集合-2
public static void 打开格式化对话框() { Process.Start("rundll32.exe"," shell32.dll,SHFormatDr ...
- 干货!IT小伙伴们实用的网站及工具大集合!持续更新!
1.Git 还在担心自己辛辛苦苦写的代码被误删了吗?还在担心自己改错了代码不能挽回吗?还在苦恼于多人开发合作找不到一个好的工具吗?那么用Git就对 了,Git是一个开源的分布式版本控制系统,用以有效. ...
- Office在线预览及PDF在线预览的实现方式史上最全大集合
Office在线预览及PDF在线预览的实现方式大集合 一.服务器先转换为PDF,再转换为SWF,最后通过网页加载Flash预览 微软方:利用Office2007以上版本的一个PDF插件SaveAsPD ...
- Android 常用代码大集合 [转]
[Android]调用字符串资源的几种方法 字符串资源的定义 文件路径:res/values/strings.xml 字符串资源定义示例: <?xml version="1.0&q ...
- Python GUI之tkinter窗口视窗教程大集合(看这篇就够了) JAVA日志的前世今生 .NET MVC采用SignalR更新在线用户数 C#多线程编程系列(五)- 使用任务并行库 C#多线程编程系列(三)- 线程同步 C#多线程编程系列(二)- 线程基础 C#多线程编程系列(一)- 简介
Python GUI之tkinter窗口视窗教程大集合(看这篇就够了) 一.前言 由于本篇文章较长,所以下面给出内容目录方便跳转阅读,当然也可以用博客页面最右侧的文章目录导航栏进行跳转查阅. 一.前言 ...
- 100多个很有用的JavaScript函数以及基础写法大集合
100多个很有用的JavaScript函数以及基础写法大集合 1.document.write("");为 输出语句2.JS中的注释为//3.传统的HTML文档顺序是:docume ...
- LINUX下编译安装PHP各种报错大集合
本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. nginx1.6.2-mysql5.5.32二进制,php安装报错解决: 123456 [root@clien ...
- 【ASP.NET实战教程】ASP.NET实战教程大集合,各种项目实战集合
[ASP.NET实战教程]ASP.NET实战教程大集合,各种项目实战集合,希望大家可以好好学习教程中,有的比较老了,但是一直很经典!!!!论坛中很多小伙伴说.net没有实战教程学习,所以小编连夜搜集整 ...
随机推荐
- [HTML/CSS]display:none和visibility:hidden的区别
写在前面 在群里有朋友问这样一个问题,display:none的标签,影响了布局.这就引出了本篇这样的问题,印象中display:none的块元素是不占位置的. 一个例子 <!DOCTYPE h ...
- 帝国cms无法注册登录快速解决方法 附路径
帝国cms安装相对比较简单,一路next,一般从网上下载的系统都会带一些数据,恢复备份数据后,清除缓存,更新数据,一个copy版的网站就出来了.但是为了se的友好需要改动很多地方,不然很容易被认为是s ...
- PHP JAVA Bridge桥的最新使用
PHP JAVA Bridge桥的最新使用 在PHP和Java之间搭建一座桥梁,利用这座桥梁在这两个实体之间建立起一个沟通渠道,在这座桥梁的帮助下,你可以在Java中开发类,然后在PHP中调用它们的方 ...
- 图解 javascript 作用域链
还是之前那一段简单的javascript代码: window.onload=function(){ function sub(a,b){ return a-b; } var result=sub(10 ...
- VMware 使用
1.客户操作系统被禁用: BIOS中开启VT(Virtual Technology)
- 数据库链接 mysql,sqlserver
1.生成对象工厂 /// <summary> /// 生成对象工厂 /// </summary> public class DBFactory { /// <summar ...
- 数据库(.udl)简单测试连接
当我们烦于打开数据库进行连接的时候,我们可以用udl进行测试连接,并可以获得连接字符串. 1.新建一个txt文件,然后将后缀改成udl保存. 2.双击打开udl文件. 3.进行数据库连接测试. 4.用 ...
- QTP10.0安装说明
QTP10.0 安装手册 注:安装之前检查清理相关注册表:运行->regdit-HKEY_LOCAL_MACHINE->HKEY_LOCAL_MACHINE\SOFTWARE->HK ...
- EasyBCD 硬盘安装Pear OS
Pear OS是一个界面很像mac的Linux distro,基于Ubuntu,免费.可惜的是pear被一个大公司匿名收购,所以现在不更新啦,最后的版本是pear 8.有个pear的替代者elemen ...
- apimonitor
1.简介 由于Andorid更新很快,较之Droidbox这种通过hook系统动态分析APK行为的方法,APIMonitor这种通过在APK包中注入监控代码(监控API调用然后保存为日志)然后重打包A ...