Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem about size with creating excel file using xml spreadsheet ? Pin
Richard MacCutchan4-Apr-13 22:37
mveRichard MacCutchan4-Apr-13 22:37 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
taibc4-Apr-13 22:41
taibc4-Apr-13 22:41 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
Richard MacCutchan4-Apr-13 23:29
mveRichard MacCutchan4-Apr-13 23:29 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
taibc4-Apr-13 23:36
taibc4-Apr-13 23:36 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
Richard MacCutchan4-Apr-13 23:41
mveRichard MacCutchan4-Apr-13 23:41 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
taibc4-Apr-13 23:51
taibc4-Apr-13 23:51 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
Richard MacCutchan4-Apr-13 23:54
mveRichard MacCutchan4-Apr-13 23:54 
GeneralRe: Problem about size with creating excel file using xml spreadsheet ? Pin
taibc4-Apr-13 23:57
taibc4-Apr-13 23:57 
Questioni use google maps api and can't remove single marker Pin
Asaf Shay4-Apr-13 13:05
Asaf Shay4-Apr-13 13:05 
QuestionAutomating website using c# windows form Pin
Nico Panares4-Apr-13 7:35
Nico Panares4-Apr-13 7:35 
AnswerRe: Automating website using c# windows form Pin
Eddy Vluggen4-Apr-13 9:38
professionalEddy Vluggen4-Apr-13 9:38 
QuestionHow to deny users from disabling my C# service Pin
candogu4-Apr-13 7:05
candogu4-Apr-13 7:05 
AnswerRe: How to deny users from disabling my C# service Pin
jschell4-Apr-13 9:24
jschell4-Apr-13 9:24 
AnswerRe: How to deny users from disabling my C# service Pin
Eddy Vluggen4-Apr-13 9:42
professionalEddy Vluggen4-Apr-13 9:42 
AnswerRe: How to deny users from disabling my C# service Pin
Dave Kreskowiak4-Apr-13 12:27
mveDave Kreskowiak4-Apr-13 12:27 
Questionhello Pin
youshy4-Apr-13 4:00
youshy4-Apr-13 4:00 
AnswerRe: hello Pin
Pete O'Hanlon4-Apr-13 4:14
mvePete O'Hanlon4-Apr-13 4:14 
GeneralRe: hello Pin
Keith Barrow4-Apr-13 4:36
professionalKeith Barrow4-Apr-13 4:36 
AnswerRe: hello Pin
Keith Barrow4-Apr-13 4:36
professionalKeith Barrow4-Apr-13 4:36 
GeneralRe: hello Pin
youshy4-Apr-13 4:57
youshy4-Apr-13 4:57 
GeneralRe: hello Pin
Pete O'Hanlon4-Apr-13 5:09
mvePete O'Hanlon4-Apr-13 5:09 
GeneralRe: hello Pin
youshy4-Apr-13 6:54
youshy4-Apr-13 6:54 
GeneralRe: hello Pin
Keith Barrow4-Apr-13 5:15
professionalKeith Barrow4-Apr-13 5:15 
GeneralRe: hello Pin
youshy4-Apr-13 6:53
youshy4-Apr-13 6:53 
QuestionUSB devices, WMI and C# Pin
MarkB7774-Apr-13 0:22
MarkB7774-Apr-13 0:22 
Hi all,

This is more of a WMI question than C#, but for lack of a more appropriate forum I am hoping someone here will know the answer.

I have a USB printer connected to my computer, and I am trying to retrieve the USB port ID for it in a C# application (i.e VID/PID).

I pulled the printer details from the WMI Win32_Printer class. The problem is the port field shows USB001 (which from what I understand is just a virtual allocation).

I discovered the actual USB port was a parent device called 'USB Printing Support', and the printer USB device was a child of that.

I pulled the WMI class Win32_USBControllerDevice and thought I found the relationship I need:
// The dependent here is the 'USB Printing Support' device I want to associate with the printer (and USB001)
Antecedent: \\MARK-PC-MKII\root\cimv2:Win32_USBController.DeviceID="PCI\\VEN_8086&DEV_1E2D&SUBSYS_84CA1043&REV_04\\3&11583659&0&D0"
Dependent: \\MARK-PC-MKII\root\cimv2:Win32_PnPEntity.DeviceID="USB\\VID_04A9&PID_271A\\0000A1A6Q2NI"

// The dependent here is the printer 
Antecedent: \\MARK-PC-MKII\root\cimv2:Win32_USBController.DeviceID="PCI\\VEN_8086&DEV_1E2D&SUBSYS_84CA1043&REV_04\\3&11583659&0&D0"
Dependent: \\MARK-PC-MKII\root\cimv2:Win32_PnPEntity.DeviceID="USBPRINT\\CANONLBP6000/LBP6018\\7&2509A3F3&0&USB001"


Unfortunately the PCI bus that both devices are related with is also related with a bunch of other devices, so I am not sure this approach will work.

Does anybody know a way I could programically relate my printer device with its parent USB device (Preferably one which I could pull the USB device info once it has been related to the printer)

Note:
If I open the properties->details window for the 'USB Printing Support' device, there is a property called 'Children' which would be perfect... I just don't know how to get to it... ;-(.

Thank you.
Mark Brock
I'm pretty sure there's a lot more to life than being really, really, ridiculously good looking

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.