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

  • 相关阅读:
    linux下的进程
    进程间通讯
    const关键字
    关于嵌入式web服务器
    指针
    内存管理(malloc和free的用法)
    关于read和fread
    C库的制作
    C语言考试
    docker 配置阿里云镜像加速
  • 原文地址:https://www.cnblogs.com/bingxing/p/8601321.html
Copyright © 2011-2022 走看看