从可移动驱动器下载文件夹

问题描述:

如何通过使用vb.net和asp.net搜索当前计算机上可用的所有可移动驱动器,从而从可移动驱动器中下载特定文件夹?

我尝试了wndproc()方法.

How to download a specific folder from a removable drive, by searching all removable drives available in the current machine using asp.net with vb.net?

I tried with wndproc() method. it is not working in web application.

尝试以下代码:

Have a try at this code:

DriveInfo[] ListDrives = DriveInfo.GetDrives();  
foreach (DriveInfo Drive in ListDrives) 
{     
  if (Drive.DriveType == DriveType.Removable)     
  {     
      //Do stuff     
  }     
}



如果这样做没有帮助,请查看这些链接;

获取已连接的USB驱动器列表 [如何找到isb字母驱动器 [在C#程序中检测USB驱动器的移除 [ ^ ]

=== [更新] ===

我刚刚注意到它是VB.Net

这是您需要的:
链接1 [链接2 [ ^ ]

祝你好运,
OI



If that doesnt help have a look at these links;

Get list of connected usb drives[^]
How to find the isb letter drive[^]
Detecting USB Drive Removal in a C# Program[^]

===[UPDATE]===

I have just noticed it is VB.Net

here is what you needed:
Link 1[^]
Link 2[^]

Good luck,
OI


您的问题是,您在后面的代码中编写的所有代码仅与部署该应用程序的服务器相关.使用vb.net代码将不允许您查看客户端的文件系统.如果您尝试在托管服务器上浏览文件系统,那么Orcun的解决方案可能会起作用,但将取决于服务器权限.
Your issue is that all the code you write in your code behind is relevant only to the server that the application is deployed on. Using vb.net code will not allow you to see the client''s file system. If you are trying to navigate the file system on the hosting server then the solution from Orcun may work, but will be dependent on server permissions.