首页 > 其他 > 详细

C-sysytem命令的使用

时间:2019-10-07 13:27:44      阅读:54      评论:0      收藏:0      [点我收藏+]

 

#include <stdio.h>



void main()
{
	printf("hello world!!");
	getchar();
	
}

  

system命令

#include <stdlib.h>


void main() {
	//system("ipconfig");
	system("mspaint");
	system("pause");
}

  

ShellExecute

也可以用来打开程序启动

#include<stdio.h>
#include<Windows.h>


void main() {
	printf("核力量");
	MessageBox(0, "窗口内容:11111111", "窗口标题", 0);
	//第一个参数 设置0  是依赖的窗口编号    0表示是系统弹出来
	//第四个参数 是窗口的类型,设置为0 即可。

	//打开文件的操作
	/*ShellExecute(0, "open", "C:\\Users\\水杉科技\\Desktop\\test.txt", 0, 0, 1);
	ShellExecute(0, "open", "https://www.baidu.com", 0, 0, 1);
	ShellExecute(0, "open", "https://www.csdn.net", 0, 0, 1);*/
	//ShellExecute(0, "print", "C:\\Users\\水杉科技\\Desktop\\test.txt", 0, 0, 1);
	ShellExecute(0, "open", "notepad", 0, 0, 1);



	getchar();
}

  

 

C-sysytem命令的使用

原文:https://www.cnblogs.com/Mengchangxin/p/11630047.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!