请看代码
public Scripting.FileSystemObject fso;
Scripting.Drive[] drvs1=new Scripting.Drive[fso.Drives.Count];
int j=0;
foreach(Scripting.Drive s in fso.Drives)
{
drvs1[j]=s;
j++;
}
我想把系统驱动器放在数组里
但提示错误
"未将对象引用设置到对象的实例"
请问是怎么回事啊是否有更好的方法解决这个问题啊
public Scripting.FileSystemObject fso;
Scripting.Drive[] drvs1=new Scripting.Drive[fso.Drives.Count];
int j=0;
foreach(Scripting.Drive s in fso.Drives)
{
drvs1[j]=s;
j++;
}
我想把系统驱动器放在数组里
但提示错误
"未将对象引用设置到对象的实例"
请问是怎么回事啊是否有更好的方法解决这个问题啊
//这里为一个数组分配了空间,但里面的每个成员没有分配
int j=0;
foreach(Scripting.Drive s in fso.Drives)
{
drvs1[j] = new Scripting.Drive(s);
j++;
}
:)
在此处提示错误
"未将对象引用设置到对象的实例"