MONO中文MONO平台技术软件开发C#编程语言 如何取得系统中存在的盘符(window)

1  /  1  页   1 跳转 查看:1952

如何取得系统中存在的盘符(window)

如何取得系统中存在的盘符(window)

using System;
using System.IO;
public class Demo
{
        public static void Main(String[] args)
        {
                foreach( string dir in Directory.GetLogicalDrives()){
                        Console.WriteLine("{0}",dir);
                }
        }
}

用MONO编译: gmcs lc.cs

此代码来源于: http://www.sinoprise.cn/showtopic-15.aspx

附件附件:

您所在的用户组无法下载或查看附件

 

回复:如何取得系统中存在的盘符(window)

Fedora 8 运行如下:
[enjoyo@YINSG664A getLocalDisk]$ gmcs getLocalDisk.cs
[enjoyo@YINSG664A getLocalDisk]$ mono getLocalDisk.exe
/
/home
/var
/media/W_WORK
/media/W_SYS
[enjoyo@YINSG664A getLocalDisk]$
 
1  /  1  页   1 跳转

版权所有 Sinoprise Network Studio   Sitemap

Powered by Discuz!NT 2.0.1214    Copyright © 2001-2009 Comsenz Inc.
Processed in 0.265625 second(s) , 6 queries. 京ICP备05062328号
返顶部