zoukankan      html  css  js  c++  java
  • 命令行启动软件

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Diagnostics;
    using System.IO;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace run3
    {
        class Program
        {
            static void Main(string[] args)
            {
    
                if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.Desktop)+"\run.ini")) {
                    Console.WriteLine("no run.ini");
                    return;
                }
                if (args.Length == 0) return;
                StreamReader sw = File.OpenText(Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\run.ini");
                String temp = "-";
                String all = "";
                
                while ((temp = sw.ReadLine()) != null)
                {
                    if (temp == "") continue;
                    if (args[0] == temp.Split(new String[] { "=" }, StringSplitOptions.RemoveEmptyEntries)[0])
                    {
                        try
                        {
    
                            Process.Start(temp.Split(new String[] { "=" }, StringSplitOptions.RemoveEmptyEntries)[1]);
                        }
                        catch(Win32Exception e)
                        {
    
                        }
    
    
                        
                    }
                    
    
                }
    
                sw.Close();
    
    
    
    
    
    
    
    
    
    
            }
        }
    }
    

      

  • 相关阅读:
    HTML
    MySQL 表操作
    MySQL 库操作
    MySQL
    python 客户端的安全性验证和服务端对客户端的多端连接
    python 黏包
    python 通信
    SpringData —— HelloWorld
    JPA
    Hibernate ——二级缓存
  • 原文地址:https://www.cnblogs.com/aliblogs/p/5809869.html
Copyright © 2011-2022 走看看