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;
}
getSteam的更多相关文章
- lombok标签之@Data @AllArgsConstructor @@NoArgsConstructor -如何去除get,set方法。@Data注解和如何使用,lombok
在代码中我们可以只加上标签@Data 而不用get,set方法: val : 和 scala 中 val 同名, 可以在运行时确定类型; @NonNull : 注解在参数上, 如果该类参数为 null ...
- HttpClinet工具类
一.URL调用 忽略https证书 1.调用 InputStream in = null; try { URL url = new URL( "url地址" ); IgnoreSS ...
- lombok标签之@Data @AllArgsConstructor @@NoArgsConstructor -如何去除get,set方法。@Data注解和如何使用,lombok
在代码中我们可以只加上标签@Data 而不用get,set方法: val : 和 scala 中 val 同名, 可以在运行时确定类型; @NonNull : 注解在参数上, 如果该类参数为 null ...
随机推荐
- 用python自建一个DNS服务器
前段日子一直在做公司的DNS调度程序,不过由于性能比较差,方案最终废弃掉了.两个半月心血,不想白白浪费掉,于是改了改,把商业秘密相关的部分去掉,变成了一个公共的DNS服务器.其实说的简单点,就是一个可 ...
- datetime.datetime.now()时间格式转化是碰到的问题
import datetime print datetime.datetime.now() # 2016-03-28 17:16:00.812000 a = ‘2016-03-28 17:16:00. ...
- HTML5 classList API
Having thrust myself into the world of JavaScript and JavaScript Libraries, I've often wondered: Whe ...
- C#利用NPOI处理excel的类 NPOIHelper.cs
个人的NPOIHelp类,包括datatable导出到excel,dataset导出到excel,excel导入到datatable,excel导入到dataset, 更新excel中的数据,验证导入 ...
- 为什么机器能够学习——PAC Learnability
机器学习中,我们根据训练集训练一个模型,来对测试数据进行预测.通常我们并不关心模型在训练集上的好坏(即训练误差,in sample error),举个简单例子,我们想要根据前六个月股市行情训练一个模型 ...
- Kernel Ridge Regression
回顾一下岭回归,岭回归的目的是学习得到特征和因变量之间的映射关系,由于特征可能很高维,所以需要正则化 岭回归的目标函数是 $$ \sum_{i=1}^n \left\|y-X\beta\right\| ...
- POJ 1328 Radar Installation(很新颖的贪心,区间贪心)
Radar Installation Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 106491 Accepted: 2 ...
- Unity透明视频播放 所需的Shader脚本
Shader "Custom/ShaderMovie" { Properties { _MainTex("Color (RGB)", 2D) = "b ...
- Mysql基于Linux上的安装
MySQL 在Linux/Unix安装 所有平台的 MySQL 下载地址为: MySQL 下载 . 挑选需要的 MySQL Community Server 版本及对应的平台. 注意:安装过程需要通过 ...
- 六个比较好用的php数组Array函数
1. array_column 返回输入数组中某个单一列的值.2. array_filter 用回调函数过滤数组中的元素.3. array_map 将用户自定义函数作用到给定数组的每个值上,返回新的值 ...