Click here to Skip to main content
15,892,059 members
Everything / USB

USB

USB

Great Reads

by Praveen Kullu
Preventing viruses in a USB drive in Windows
by Mike Meinz
PartnerTech provides a 32-bit DLL and a 64-bit DLL for communicating with the CD-7220 Series Customer Display in true USB mode. This tip demonstrates a .NET class that can be used to provide an easy way to access the PartnerTech-provided 32-bit DLL.
by thatraja
Found these linksTroubleshooting: USB Device Not Recognized[^]From Link1[^]:Cause #1: Outdated Device DriverCause #2: USB Device shares the same drive letter as another device already plugged inCause #3: All USB devices suddenly stop workingCause #4: Damaged USB PortCause #5:...

Latest Articles

by ToughDev
Custom USB device that processes input from peripherals and displays on computer
by ToughDev
How to interface NEO-6M GPS module to PIC
by ToughDev
How to integrate FatFs FAT filesystem module with CH375/CH376 USB controller
by Marco Bertschi
Serial communication with an Arduino Board via C# and the SerialPort class from the System.IO.Ports namespace

All Articles

Sort by Updated

USB 

31 Dec 2010 by #realJSOP
You can get USB parallel and serial port adapters (hardware). They're typically less than $10. There shouldn't be any reason to change your obsolete code.
1 Jan 2011 by #realJSOP
You can't possibly expect 10-year-old code to remain relevant. Technology marches on, and that in turn makes software obsolete. My advice is to rewrite your code.
24 Mar 2011 by #realJSOP
Personally, I would never use a piece of software that required a dongle be plugged in so that it would run. You'd be better off having it verify itself over the internet, which could be easily configured to allow the software to run a certain number of times without an internet connection...
20 Oct 2011 by 01.mandar
i have 2 Bluetooth1. PC dongle and 2. Mobile Bluetooth Device of same make in normal installation we goto Control Panel and do add device ,this device directly gets added in the system and pair with each other without using any key.i want to automate this by getting event from the OS...
20 Feb 2015 by A.Castillo
Hi all,I have a Microsoft USB webcam and I want to record the video/audio stream. I found a very useful C# web camera software but I don’t get any audio from the camera’s microphone. Here is the code I am trying to employ:connector.Connect(_camera, _mpeg4Recorder.AudioRecorder); //This...
26 Feb 2015 by A.Castillo
Thanks for the answers, in the meantime I could figure it out myself. I made a mistak in the code.connector.Connect(_microphone,_mpeg4Recorder.AudioRecorder);This is the right one, first i tried to connect the camera to the _mpeg4Recorder.AudioRecorder instead of the microphone. My bad,...
24 Oct 2016 by abbabbabba
Hi all! I've got one client machine that fails when using my application attempting to copy thousands of files from an USB stick. An error message is thrown after a few files are copied, and a lot of folders are created on the hard drive. The error message says that the USB stick is write...
25 Oct 2016 by abbabbabba
The cause of the problem lies in the code:There is an array containing thousands of files that should be copied.Depending on earlier settings, possibly made months ago, some files should not be copied.When the code skips copying a file that should not be copied, it should also skip...
5 Nov 2013 by Abhinav S
Tryhttp://www.instructables.com/id/How-to-make-flash-drive-that-copys-users-files-si/step2/[^]http://techdows.com/2009/01/set-your-favorite-picture-as-drive-icon.html[^]
12 Oct 2015 by Abhinav S
TryA USB Library to Detect USB Devices[^]Detecting USB Insertion/Removal in C# .Net 4.0[^]
7 Apr 2023 by agus tison
How make autorun from usb in c# What I have tried: How make autorun from usb in c#
8 Sep 2015 by Ajith.Kerala
USB thumb drives USB harddisks USB DVD writer USB Bluetooth devices USB headsets usb mouse USB keyboard USB webcams / camerasJust want to detect any sort of usb device using event handler...Would appreciate any help... WqlEventQuery...
13 Aug 2010 by Alan Ott
Calling HidD_GetFeature() returns TRUE on success. It does not return in any way the number of bytes in the report.I decided there must be a function in the HID.dll API which would give me the number of bytes in each report (as parsed from the HID Descriptor). Keep in mind, what I'm looking...
1 Jun 2011 by ameUmber
Hi...!!!I want to connect a USB drive through my code, but I am unable to add USBLibrary.dll reference to my code. Can anyone help me?How can I do that..???Thanks..!!
30 May 2016 by amitrkcian
AS my development machine & my test machine are 64bit windows system with Windows 7 operating System So to give myself a head start I compiled the ComPort project under Windows-driver-samples-master/serial/VirtualSerial2 sample code provided by Microsoft, initial it flashed an error that said as...
1 Nov 2011 by André Kraak
Once the converter is installed properly you can handle it as a normal serial port.CP has many articles on the subject, here are a few: Win32 SDK Serial Comm Made Easy[^] CSerialIO - A Useful and Simple Serial Communication Class[^] Serial library for C++[^]
30 Nov 2012 by André Kraak
These MSDN example should be helpful: How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)[^].The idea is to recursively copy the folder, by first creating the folder at the destination (if needed) and then copy all the files in the source folder to the destination.
21 Oct 2019 by Andy Lanng
Pretty sure that because you get two alerts, and I get 4, the code scans all usb ports when an item is connected or disconnected.
11 Oct 2020 by Anh Chu
Hi guys,I have a system connect to PC through USB. I am writing the software that has "Connect" button which allows user to connect to that specific USB port. My solution is 1. Scan all available COM ports 2. Send a specific message to each COM port and if the system echo back another...
28 Aug 2010 by Anh Chu
Yes, I am talking about a USB that connects as a COM port. And yes, I do a SerialPort.GetPortNames() to get the COMx name, and connect to that specific USB. But I am facing the problem, let's say the PC I connect the USB has the following COM (in device manager):1. COM1: Communication...
29 Aug 2010 by Anh Chu
Hi,Actuall...
10 Jun 2012 by Artem Verbuk
Hi everyone.I am developing some application that uses device, with FTDI chip on board, connected to PC through USB. Application uses ft2xx.dll. It will be very nice If my application would be able to recognize device removal and insertion. I can do it with some timer, that constantly tries...
3 Feb 2012 by Ashok19r91d
Hi Everybody,Is it Possible to Use USB Port as Serial Port?So that It's Better and Easy to Handle IO in .NetSuggest your Ideas to use USB as Serial...
17 Oct 2019 by asitha32
I connected an external USB device to my computer yesterday and after a while, I was told that I could not detect a USB device. This is a big problem for me. I need to fix this quickly. If anyone knows how to fix this please let me know and I would appreciate it Thank you What I have tried: ...
30 Jan 2012 by Auric Consulting, LLC
In the code below, there is a BeginRead call which I want to use in an async manner. (warning, code is cobbled together using a variety of code samples found lying around on the internet!) With this sample, I expect the BeginRead to return immediately, and then the callback to be hit later on...
1 Apr 2012 by basith7861
HIIm having hardtime here in usb barcode scanner.if it is working on ur end Please send me ur sample codethanksbasith7861@gmail.com
25 Oct 2012 by Bernhard Hiller
Not fully safe, but generally good enough:Get the DeviceModelManagementObjectSearcher mos = new ManagementObjectSearcher("select model from Win32_DiskDrive");encrypt that value and store it in a Resource file.When you run your program, just check that a disk with an acceptable name is...
11 May 2014 by Bernhard Hiller
The term "USB audio class" is the item which mislead you. It is not at all important from which type of external/internal connection the sound comes from. Also an external sound card connected via USB is simply: a sound card. So just look for any tutorial on audion recording in your preferred...
4 Apr 2013 by Bharat Mane
How to detect an incoming USB device in windows Service on Windows XP machine?Hello Experts,I an trying to write a simple Windows Service that shall detect any incoming USB device and Launch a GUI application. WqlEventQuery query = new WqlEventQuery("SELECT * FROM...
11 May 2014 by BillWoodruff
There are many resources on CodeProject for C# code to record sound. Here's a recent (April, 2014) article: "Play or Capture Audio Sound. Send and Receive as Multicast (RTP)" [^].The BASS library (free for non-commercial use) is very powerful library for all types of sound manipulation, and...
20 Dec 2014 by BillWoodruff
CodeProject is your friend: [^]"This article describes my C# class called DriveDetector which will allow your program to receive a notification when a removable drive (such as a flash drive) is inserted or removed. It also supports notifications about pending removal of such a device and...
10 Jun 2014 by bling
Your best course of action is to purchase a USB tuner that provides IQ sampled data. Your TV tuner's driver likely doesn't support IQ samples and I don't think Direct-X was ever designed for this.A Realtek RTL2832U USB tuner device can be purchased for USD $20 or less (and there are over a...
8 Feb 2012 by bpatron
i have 4 ports usb in my computer, and what i need is:any device that connects to port 1 for example has the always the same com,what i need is that, exampleport 1 ,com4port 2 ,com5port 3 ,com6port 4 ,com7any device what i connect to the port i need what have the define...
12 Oct 2012 by cclaudio
Hello,I'd like to know if there is the possibility to communicate within specific vendor class USB device without install any driver for example to use generic USB windows driver. I need for Windows XP and Windows 7. I know there is this possibility for Human Interface Device using a HID...
8 Dec 2014 by Charles Fernando
Hi,I m trying to build an application which can send text messages to the contacts of a connected Android phone. So as the first step I need to check whether an android device is connected via a USB port and the phone should be an Android phone. And I m using C# for this application.So guys...
18 Jun 2012 by charlesmister
Hi everyone,I'm a beginner at c# and i really need to know how to capture video and audio from a capturing HW plugged by USB. I'm using Grabster AV300 and it works fine in the provided software. Now i want to adquire the signal and display it im my winform. I've tried some articles mentioned...
4 Sep 2012 by charlesmister
Found it! The solution was rendering the audio also because i was only rendering the video. (just in case if someone is facing the same issue).
28 Jul 2011 by Chathura Sarathchandra
Hi I am a newbie to driver development and I want to write a driver or a filter driver to block and re enable usb ports. Basically my project is to block/lock certain usb storage devices, which are not registered with my user mode application. So I am looking if there is a way that I...
13 Aug 2011 by Chathura Sarathchandra
Hi everyone, I have made a minifilter driver which only attaches itself to usb devices. I want it to look for a certain file on the device as soon as it attaches. please correct me if I am wrong.so to specify the name of the specific file, you need to getthe device name first? so...
28 Nov 2011 by chieto
using avicap.dllplease help me.
21 Mar 2016 by CHill60
Quote:Use Device Manager to disable and re-enable all the USB controllershttps://support.microsoft.com/en-gb/kb/817900[^]
2 Sep 2010 by Christian Graus
Please don't use answer to ask questions, esp to just ask the question again.What do you mean by dongle ? A USB device that provides security, or just a memory stick ? You can iterate over all the drives connected in C# and tell which are removable drives, then you can find out how much room...
13 Jun 2011 by Christian Graus
As a barcode scanner typically provides input as if it came from the keyboard, I don't think there's really anything you can do. The whole point of a USB device is that it integrates, not that it identifies itself. Unless you can identify the device from the EventArgs you're sent in the...
30 May 2012 by Clifford Nelson
The SerialPort class is great for this: http://msdn.microsoft.com/en-us/library/system.io.ports.serialport.aspx[^]. also see http://www.developerfusion.com/article/84338/making-usb-c-friendly/[^]
6 Jun 2012 by Clionadh Martin
Hi guys!!I'm trying to develop a program that communicates with a USB device. I've just started playing around with some functions and I need some help.I wrote the code bellow and when I compile it, I have no errors but when i run it i get the following errors:1>Rev 4.obj : error...
6 Jun 2012 by Clionadh Martin
I tried a few of those already, any other ideas?
8 Jun 2012 by Clionadh Martin
Ok, thanks to superman and sorren for your quick answers. I had already tried them but I finally figured out my problem :).Anyway, the problem above resulted from another problem I had.I had to download SDK 7.1 and then i had to change the platform toolset (configuration properties ->...
20 Sep 2012 by Coder Block
Hi Experts,After spending my whole last night on google i doesn't found any thing useful to solve my problem.so my last choice is all of you guys,now problem start when,I improves my window based application from serial communication to USB communication for hardware device...
8 Oct 2012 by Coder Block
// usbhidiocDlg.cpp : implementation file/*Project: usbhidioc.cppVersion: 3.0Date: 7/18/05by Jan Axelson (jan@Lvr.com)Purpose: demonstrates USB communications with a HID-class device.Description: Finds an attached HID-class device that matches a specified Vendor ID and...
4 Oct 2012 by Coder Block
Hi Guys,Really USB communication is far hardar and Interesting than Serial communication but still, i need support of USB communication in my software.As per some guidance from masters and documents from Codeproject i finally decide to used WDK ..WDK take my whole day to install!!!!i am...
9 May 2013 by Cosmin D Popescu
Hi there,I have an issue regarding developing a secure way of doing licensing for a software application. This application would allow the user the possibility to use some how of "offline licenses" for consuming, stored in an encrypted file. The problem is that the main vulnerability is...
11 Jan 2012 by CPallini
Usually the device manufacturer provides an API for interfacing the device with the PC (read the documentation). Very often (for low speed devices) they provide a serial port emulator, that is you communicate with the device using standard RS232 communication (again, check out your device...
14 Feb 2012 by CPallini
I2C stands for 'Inter-Integrated Circuit'. The name is an hint of what happens: "serial communication between integrated circuits", e.g. microcontroller communicating with external EEPROM.Why do you need I2C on the PC side?Uusually the PC communicates with a microcontroller (via RS232 or...
20 Sep 2012 by CPallini
First of all, sleep (it helps keeping you healthy).Using virtual serial port on USB is often fine. If you need to write data on a pen drive the I believe the easier way is (by far) using OS file functions (you only need to detect when the pen drive is plugged in, using, for instance...
2 Aug 2013 by CPallini
In my opinion, you should use a microcontroller to switch ON/OFF the LEDs (or control other hardware). In turn your laptop would communicate with the microcontroller (directly via USB or by means of a virtual COM on the USB).The direct connection of the LEDs (or other hardware) may (if wrong)...
18 Oct 2017 by CPallini
The USB to serial converters (at least the one I know of) work in the opposite direction (they are USB devices, you need a USB host for your RFID device). Quote: Searched high and low for a desktop serial RFID reader; they are either 1.3GHz or USB only However they could possibly behave...
20 Oct 2010 by cs101000
I am working on a windows forms application project. I have a serious problem in communicating with my avr microcontroller: at90usb1287. I have designed a form using vc# And according to the input from the user, am going to send data to eeprom of the avr micro. I want to send data into its...
5 Dec 2012 by cschenlu
hello,I'm a windows programmer. I've recently met a problem on usb driver, sincerely hope I could get your reply. My usb driver doesn't work well with usb device. It's a webcam device. when I start this webcam, it always display white no matter what we show before it. I use bus hound to...
11 May 2013 by cw2290
Hi, Pretty much just joined, properly anyway.. Im designing a robot, intention is to link a pc client to the wireless robot.Theres a video link back from the robot to the pc.. its a composite video link and was intended to just be on the screen, but id like to integrate this using the...
12 May 2013 by cw2290
sure!how can i be more precise?Windows operating system using Visual Studio 2010 to develop in.. id like to initially just display the video in a window, no processing on it or anything of that sort. just display the video on the screen via the usb capture device.. could you perhaps ask some...
1 Jun 2011 by Dalek Dave
To disengage the annoying pop-up showing that the USB device is not recognised even when nothing is connected.
25 Dec 2011 by Dalek Dave
Does this help?[^]
23 Jan 2015 by Darren1964
As you mentioned, this is a sample directly from LibUsbDotNet. It does build and run from your description. It is very likely that you have not setup the filter driver that allows you to communicate to your device.In your "Program Files\LibUsbDotNet\libusb-win32" folder, you should find...
29 Mar 2011 by Dave Kreskowiak
You have to tell the applications with the files open to release them. Forcing the file handles closed outside of the application that opened it will only cause data loss and possible disk corruption.
20 May 2011 by Dave Kreskowiak
That's because you're trying to treat the USB port as a port like you would a serial or parallel port. Look at what USB stands for: Universal Serial BUS. A USB is not a port, but a BUS, not unlike the expansion slots inside your computer.You interface with the device attached to the port,...
3 Feb 2012 by Dave Kreskowiak
Your question is so vauge and generic, the only answer you're going to get is this[^].
6 Jun 2012 by Dave Kreskowiak
Not that I know of, no. I don't know of an interface exposed by it that will let you query that information.
24 Jan 2014 by Dave Kreskowiak
First, you have to know how this device exposes itself to your code. Is it through a COM (serial) port or what? Without knowing that, it's IMPOSSIBLE to talk to the device.Consult the documentation on the device and/or the SDK for it, if there is one.
26 Mar 2014 by Dave Kreskowiak
Windows doesn't maintain any such log of device insert/removals so your app is dead in the water before you even begin.
27 Mar 2014 by Dave Kreskowiak
From your applications standpoint you don't even think of USB at all. Your code should just be concerned with serial communication, that's all. USB has NOTHING AT ALL to do with what your application is doing.Since we know nothing of any error messages you're getting, what exactly you...
14 Apr 2014 by Dave Kreskowiak
The best way to do it is over a serial connection as all Arduinos have serial interfaces. You can get a USB-to-Serial converter and talk with the board over a COM port. That's been documented thousands of times all over the web. And, yes, it works over just about any speed.
29 Sep 2015 by Dave Kreskowiak
One problem you're going to run into is that any C# app requires the .NET Framework to be installed on the machine before you can run the app. If the framework is not installed your code doesn't run.The only way you're going to "protect" the contents of the drive with a password is if all...
15 Dec 2016 by Dave Kreskowiak
Really, its' just File/Open ... in ANY program you want that can edit text files. You could use Notepad if you felt like it. There is nothing special about these files. They're just text files.
19 Oct 2017 by Dave Kreskowiak
You're not going to such an adapter. Your "adapter" would have to be smart enough to know that it's connected to a keyboard HID device and how to translate "keystrokes" to serial data. Your problem is that you're using a "keyboard wedge" scanner. The scanner exposes itself as a keyboard to the...
14 May 2022 by Dave Kreskowiak
You're going to have to get a hold of the authors of the library.
27 Aug 2010 by DavidKiryazi
Hi,Are you talking about USB or COM port emulator? It sounds like you are talking about a USB that connets as a COM port emulator.If that is the case, you can use the following method to get the list of names of com port devices.SerialPort.GetPortNames();you can then iterate...
9 Nov 2016 by debasish mishra
Some pointers.Youtube video.net Micro Framework implementationWPF you can always know how to do or what to do but communication should work out by implementating progamming languages like c#
9 Nov 2012 by Deka Prikarna A.
Simple URB (USB Request Block) Monitor
22 Jun 2013 by Denys
USB Sniffer (driver filter) source code http://tellmeword.com/dh9ic/usb_sniffer_(source_code)
9 Apr 2013 by desowin
You can use Open Source sniffer: USBPcap[^]This logs data on specified roothub and then you can analyse it using Wireshark.It shows the basic IRP information like USBD_STATUS, URB function, IRP direction (from PDO to FDO or the other way round) and basic USB information like device...
14 Oct 2010 by devenderSynoro
Iam using usb hid device but i want to its purpose. please help me
12 Dec 2011 by Digiteka
Hi, how to identify in Windows which USB device is which physical port. I mean, i have 3 USB modems conencted to computer. I know each one its COM ports, but i didn't know wich modem(COM port) is wich Physical USB connection.Please, how can i identify them?Thank you
13 Dec 2010 by DisneyCHZ
I wrote a virtual USB bus driver in Windows, after it enumerate the USBSTOR driver, in the usb bulk or interrupt transfer phase, the USBSTOR driver will send some IRPs with MDL pointer. It means that using direct I/O method (but strangely, the "Method" in the IRP is "Neither"). When I use the...
16 Dec 2010 by DisneyCHZ
I know the reason now. Before getting the virtual address here, I did a wrong thing. I lower the IRQL, this is a fatal error.
11 Sep 2012 by djdynamix
OK, here's my problem. (Sorry about the length of the question, but I want to give sufficient information so I don't get "noobie" answers!)I'm writing some system management software to administer Win7 systems which my company has out on rental. The machines are all locked down with a...
19 Sep 2012 by djdynamix
I'd like to thank everyone who gave their time and thought to this, especially ledtech3, who probably now has less hair than when we started, thanks to trying to sort out the API calls on MSDN!I have now worked out a solution. It wasn't the one I'd originally intended, but in many ways it...
29 Apr 2013 by dmitryponv
Good evening,The device under test is MicroChip USB Starter Kit 2.The problem began appearing after adding some SPI initialization code to HID - Custom Demo program from 10-15-2012 microchip solutions framework.Before the code was added everything in the demo worked...
29 Apr 2013 by dmitryponv
I found a solution to the problem, I don't know if it's a bug to the Microchip USB stack But I added a line inside USBDeviceAttach(void) IEC0CLR=0x03800000; // // disable all interrupts Right before USBEnableInterrupts(); //Modifies global interrupt settings which...