在Powerbuilder中编写此Visual Basic代码

时间:2018-09-12 10:12:14

标签: powerbuilder

如何在PB中编写以下VB代码?

Dim fso As New Scripting.FileSystemObject()

For Each str As Scripting.Drive In fso.Drives
    If str.IsReady Then
       TextBox1.Text += "Volume Name : " & str.VolumeName 
    End If
Next

2 个答案:

答案 0 :(得分:1)

尝试一下:

List<String> list = new ArrayList();
Iterator<String> keys = response.keys();
while (keys.hasNext()) {
    try {
        list.add(response.getString(keys.next()));
    } catch (Exception e) {
      // ignore me
    }
}
ArrayAdapter<String> locationAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);
locationAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

答案 1 :(得分:-1)

您将需要声明并使用Windows API来实现此类功能。大概是GetLogicalDrives或类似的东西。您可能希望看看Topwiz Software的Roland Smith的Filesys应用程序(www.topwizprogramming.com下的免费代码)。此示例应用程序已编码了许多系统信息/操作方法。