usb-drive

Get serial number of usb storage device in .net core 2.1

ε祈祈猫儿з 提交于 2019-11-26 08:35:53
问题 How can I get the serial number of usb storage device in .net core 2.1 ? I found different solutions, but sadly they don\'t work due the lack of windows registry and wmi in .net core. In Powershell it really simple, but I wasn\'t able to find a implementation in Powershell Core. PS C:\\> Get-Disk | Select-Object SerialNumber SerialNumber ------------ 0008_0D02_0021_9852. I prefer a solution with no extra installs on the clients (Win, Linux, Mac). 回答1: This Class performs a series of queries

Nexus 4 not showing files via MTP

别来无恙 提交于 2019-11-26 05:52:18
问题 I\'m trying to simply write a simple XML file to the SD card and I noticed that my Nexus 4 does write the file, but it is not viewable via the MTP protocol using Windows 7. code: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CustomerQueryRqType customerQueryRequest = new CustomerQueryRqType(); Serializer serializer = new Persister(); File myFile = new File(Environment.getExternalStorageDirectory() + \"/customerQueryRequest

How to detect a USB drive has been plugged in?

梦想与她 提交于 2019-11-26 04:11:34
问题 I want to build a program that detects if a usb (or two or more) are plugged in (and copy all contents to any folder on a hard disk) Any ideas? I have this, using System.Runtime.InteropServices; But it is not the easy way (that I believe). I want something easy. I have another idea (if (folder exist) then copy) something -- but there may be a problem with that, and I want a good solution. There may also be a tool called SerialPort; can I use it? If so, how do I use it? 回答1: It is easy to

Custom bootloader booted via USB drive produces incorrect output on some computers

…衆ロ難τιáo~ 提交于 2019-11-26 01:45:55
问题 I am fairly new to assembly, but I\'m trying to dive into the world of low level computing. I\'m trying to learn how to write assembly code that would run as bootloader code; so independent of any other OS like Linux or Windows. After reading this page and a few other lists of x86 instruction sets, I came up with some assembly code that is supposed to print 10 A\'s on the screen and then 1 B. BITS 16 start: mov ax, 07C0h ; Set up 4K stack space after this bootloader add ax, 288 ; (4096 + 512)