读取计算机端口 [英] Reading computer ports

查看:85
本文介绍了读取计算机端口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
如何在C#/VB.Net中读取USB端口和SD卡端口?

问题陈述是:

正确检测外部驱动器是否已插入机器. (要监视的USB端口和SD插槽)

Hi All,
how can i read USB ports and SD card ports in C#/VB.Net ?

problem statement is:

detect the external drives right they are plugged into machine. (USB ports and SD slot to monitor)

推荐答案

以下C#代码提供了计算机中的逻辑驱动器:

Below C# code supplies the logical drives in a machine:

String[] drives = Environment.GetLogicalDrives();
Console.WriteLine("GetLogicalDrives: {0}", String.Join(", ", drives));


这篇关于读取计算机端口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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