从可移动驱动器下载文件夹 [英] Downloading a folder from removable drive

查看:103
本文介绍了从可移动驱动器下载文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过使用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.


这篇关于从可移动驱动器下载文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆