您的位置:程序门 -> java -> 框架、开源



jconfig无法获取u盘信息


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


jconfig无法获取u盘信息
发表于:2007-03-18 20:11:59 楼主
当u盘里的剩余空间超过一半时,jconfig就无法获取到它的信息?
程序如下:
package   com.xu.ycoe.commons.util;

import   java.io.file;

import   com.jconfig.diskvolume;
import   com.jconfig.fileregistry;

public   class   disk   {
private   string   name;

private   string   id;

private   long   volume;

private   long   freevolume;

private   int   type;

public   disk()   {
file   curdir   =   new   file( "c:/ ");
fileregistry.initialize(curdir,   0);
diskvolume[]   diskvolume   =   com.jconfig.fileregistry.getvolumes();
for   (int   i   =   0,   c   =   diskvolume.length;   i   <   c;   ++i)   {
diskvolume   diskvolume   =   diskvolume[i];
string   rootname   =   diskvolume.getprefix();
this.setfreevolume(diskvolume.getfreespace());
this.setid(diskvolume.getreferencenumber()   +   " ");
this.setname(diskvolume.getdisplayname());
this.settype(diskvolume.getflags());
this.setvolume(diskvolume.getmaxcapacity());
  system.out.println( "======== "   +   name);
  system.out.println(freevolume+ "freevolume: ");
  system.out.println(volume+ "volume: ");
  system.out.println( "type: "   +   type);
  system.out.println( "id: "   +   id);

}
}

public   long   getfreevolume()   {
return   freevolume;
}

public   void   setfreevolume(long   freevolume)   {
this.freevolume   =   freevolume;
}

public   string   getid()   {
return   id;
}

public   void   setid(string   id)   {
this.id   =   id;
}

public   string   getname()   {
return   name;
}

public   void   setname(string   name)   {
this.name   =   name;
}

public   int   gettype()   {
return   type;
}

public   void   settype(int   type)   {
this.type   =   type;
}

public   long   getvolume()   {
return   volume;
}

public   void   setvolume(long   volume)   {
this.volume   =   volume;
}

/**
  *   @param   args
  */
public   static   void   main(string[]   args)   {
//   todo   auto-generated   method   stub
new   disk();
}
}


在控制台打印出来的结果:
jconfig   evaluation   version   2.2.0
copyright   (c)   1997-2002   samizdat   productions.   all   rights   reserved.
visit   us   at   www.tolstoy.com

========本地磁盘   (c:)
549785600freevolume:
8003162112volume:
type:79
id:1621638811
========tools   (d:)
807600128freevolume:
15002877952volume:
type:79
id:-1591808764
========games   (e:)
483143680freevolume:
30005788672volume:
type:79
id:-1434086071
========another   (f:)
922939392freevolume:
27011784704volume:
type:79
id:42900624
========system   (g:)
3993886720freevolume:
10001907712volume:
type:79
id:-1717648047
========workplace   (h:)
14648504320freevolume:
20003848192volume:
type:79
id:-506158908
========medio   (i:)
33458339840freevolume:
40007729152volume:
type:79
id:-1124747039
========document   (j:)
41110798336freevolume:
50017894400volume:
type:79
id:1366065296

而我还有一个u盘(为空),为m:则无法获取到,而当我将u盘装上东西(超过容量的一半),打印出的信息如下:

jconfig   evaluation   version   2.2.0
copyright   (c)   1997-2002   samizdat   productions.   all   rights   reserved.
visit   us   at   www.tolstoy.com

========本地磁盘   (c:)
627441664freevolume:
8003162112volume:
type:79
id:1621638811
========tools   (d:)
807600128freevolume:
15002877952volume:
type:79
id:-1591808764
========games   (e:)
483143680freevolume:
30005788672volume:
type:79
id:-1434086071
========another   (f:)
922939392freevolume:
27011784704volume:
type:79
id:42900624
========system   (g:)
3993886720freevolume:
10001907712volume:
type:79
id:-1717648047
========workplace   (h:)
14648504320freevolume:
20003848192volume:
type:79
id:-506158908
========medio   (i:)
33458339840freevolume:
40007729152volume:
type:79
id:-1124747039
========document   (j:)
41110798336freevolume:
50017894400volume:
type:79
id:1366065296
========ycoe   (m:)
13799424freevolume:
250814464volume:
type:37
id:1208040688

发表于:2007-05-02 23:16:571楼 得分:0
没人理...郁闷,自己顶下


快速检索

最新资讯
热门点击