zoukankan      html  css  js  c++  java
  • getSteam

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Management;
    using System.IO;
    using System.Diagnostics;


    //获取steam的路径
    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;
    }
    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;


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

    if (Directory.Exists(steam))
    {
    return steam;
    }
    return null;
    }

  • 相关阅读:
    sge的简单的应用
    dcoker 小应用(二)
    浅谈Docker(二)
    查看Linux版本
    dcoker 小应用(一)
    linux 强制重启!
    浅谈Docker(一)
    ubuntu command
    简析hotjar录屏功能实现原理
    实现node端渲染图表的简单方案
  • 原文地址:https://www.cnblogs.com/bingxing/p/8601321.html
Copyright © 2011-2022 走看看