zoukankan      html  css  js  c++  java
  • C-sysytem命令的使用

    #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();
    }
    

      

  • 相关阅读:
    java中finally的使用
    String基本方法
    java文件读写常用方法
    java笔试面试(转载)
    单链表的反转
    单链表的冒泡排序
    Java快速教程
    Java快速教程
    后海日记(4)
    后海日记(3)
  • 原文地址:https://www.cnblogs.com/Mengchangxin/p/11630047.html
Copyright © 2011-2022 走看看