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

getSteam的更多相关文章

  1. lombok标签之@Data @AllArgsConstructor @@NoArgsConstructor -如何去除get,set方法。@Data注解和如何使用,lombok

    在代码中我们可以只加上标签@Data 而不用get,set方法: val : 和 scala 中 val 同名, 可以在运行时确定类型; @NonNull : 注解在参数上, 如果该类参数为 null ...

  2. HttpClinet工具类

    一.URL调用 忽略https证书 1.调用 InputStream in = null; try { URL url = new URL( "url地址" ); IgnoreSS ...

  3. lombok标签之@Data @AllArgsConstructor @@NoArgsConstructor -如何去除get,set方法。@Data注解和如何使用,lombok

    在代码中我们可以只加上标签@Data 而不用get,set方法: val : 和 scala 中 val 同名, 可以在运行时确定类型; @NonNull : 注解在参数上, 如果该类参数为 null ...

随机推荐

  1. php无极限分类函数

    /** * [make_tree description] * @Author Lerko * @DateTime 2017-04-01T14:57:24+0800 * @param [type] $ ...

  2. MS12-020蓝屏攻击

    MS12-020远程桌面协议RDP拒绝访问漏洞 条件:受害者必须开放RDP协议 开放了3389端口 或者端口改了,知道对方RDP开放的对应端口. 过程:MSF利用 MSF显示为seems down说明 ...

  3. Kali-linux基本设置

    1.6.1 启动默认的服务 Kali Linux自带了几个网络服务,它们是非常有用的.但是默认是禁用的.在这里,将介绍使用各种方法设置并启动每个服务. 1. 启动Apache服务 启动Apache服务 ...

  4. springboot+mybatis+shiro——登录认证和权限控制

    转载:https://z77z.oschina.io/ 一.引入依赖 shiro-all包含shiro所有的包.shiro-core是核心包.shiro-web是与web整合.shiro-spring ...

  5. java中prepareStatement与createStatement的区别

    首先来看两段代码: 第一个使用createStatement() public void delete( int id){ try { Connection c = DBUtil.getConnect ...

  6. 如何用C#对Gridview的项目进行汇总统计?

    上一次用了javascript对gridview进行了汇总统计,但那个统计是在客户端进行的,虽然减轻了服务器的负担,但是,当需要把统计信息汇出excel时,汇总信息却死活不出来了,所以,绕半天又绕回来 ...

  7. 友盟分享——Android App接入微信开放平台注意事项

    一.Android第三方应用接入微信开放平台的注意事项: 1. 到微信开放平台官网申请正式的AppID(需通过审核),要填写包名.app签名的md5值.至于如何获取app签名信息,官方提供签名包apk ...

  8. 淘宝前端框架kissyui

    http://docs.kissyui.com/1.4/docs/html/guideline/why-kissy.html

  9. [转]:理解 Linux 配置文件

    简介: 本文说明了 Linux 系统的配置文件,在多用户.多任务环境中,配置文件控制用户权限.系统应用程序.守护进程.服务和其它管理任务.这些任务包括管理用户帐号.分配磁盘配 额.管理电子邮件和新闻组 ...

  10. Appstore|IPA

    ios提审报错:No suitable application records were found. Verify your bundle identifier 'xx' is correct - ...