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

      

  • 相关阅读:
    Prometheus—告警altermanger
    Prometheus监控Kafka
    get与post(转)
    js typeof
    设置SQL脚本大小敏感
    max Count Group by
    统计当年登陆次数
    IOC
    ORM
    [转载]C#实现获取浏览器信息
  • 原文地址:https://www.cnblogs.com/aliblogs/p/5809869.html
Copyright © 2011-2022 走看看