zoukankan      html  css  js  c++  java
  • 吃鸡启动器

    using System;
    using System.IO;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    using System.Threading.Tasks;
    using System.Diagnostics;
    using System.Management;
    using System.Windows.Forms;

    namespace ConsoleApp1
    {
    class Program
    {
    static void Main(string[] args)
    {
    string sSteam = getSteam() + "\Steam.exe";
    try
    {

    Process.Start(sSteam);
    }
    catch
    {
    MessageBox.Show("没有找到Steam.exe的位置");

    }



    }

    //获取steam的路径
    static string getSteam()
    {
    string sSteamDir = "";
    //获取本地磁盘
    DriveInfo[] aDr = DriveInfo.GetDrives();
    foreach (DriveInfo dd in aDr)
    {
    if (dd.DriveType == DriveType.Fixed)
    {

    sSteamDir = isSteam(dd.ToString().ToLower());
    if (sSteamDir != null)
    {
    return sSteamDir;
    }
    }
    }
    return null;
    }
    static string isSteam(string sDir)
    {
    string steam = "";
    DirectoryInfo dDir = new DirectoryInfo(sDir);
    if ((steam = isExists(sDir)) == null)
    {
    foreach (DirectoryInfo d in dDir.GetDirectories())
    {
    if ((steam = isExists(sDir + d.ToString())) != null)
    {
    return steam;
    }
    }

    }
    return null;


    }
    static string isExists(string d)
    {
    string steam = d + "\steam".ToLower();

    if (Directory.Exists(steam))
    {
    if (Directory.EnumerateDirectories(steam, "Steam.exe", SearchOption.AllDirectories).Any()==false)
    return steam;
    }
    return null;
    }


    }
    }

  • 相关阅读:
    【IDEA】颜色主题 Color Theme
    【IDEA】IntelliJ IDEA 2020.1破解版
    【HTML】基础
    SQLyog
    【GitHub】本地代码上传
    【NetWork】外网和内网
    C#根据PDF模板生成内容
    layui数据表格显示与导出问题
    LayUIDataResult
    LayUIParameter
  • 原文地址:https://www.cnblogs.com/bingxing/p/8612838.html
Copyright © 2011-2022 走看看