Click here to Skip to main content
15,917,808 members
Home / Discussions / C#
   

C#

 
AnswerRe: Message Box start position Pin
Flow8410-Aug-06 0:45
Flow8410-Aug-06 0:45 
AnswerRe: Message Box start position Pin
Andrei Ungureanu10-Aug-06 2:43
Andrei Ungureanu10-Aug-06 2:43 
GeneralRe: Message Box start position Pin
AnnnS10-Aug-06 4:07
AnnnS10-Aug-06 4:07 
QuestionStarting external web browser with URL Pin
Stefan Spenz9-Aug-06 23:35
Stefan Spenz9-Aug-06 23:35 
AnswerRe: Starting external web browser with URL Pin
Eduard Keilholz9-Aug-06 23:40
Eduard Keilholz9-Aug-06 23:40 
GeneralRe: Starting external web browser with URL Pin
Stefan Spenz9-Aug-06 23:47
Stefan Spenz9-Aug-06 23:47 
QuestionDetect audio cd inserted Pin
Eduard Keilholz9-Aug-06 23:20
Eduard Keilholz9-Aug-06 23:20 
Questionusers setting prefered printers Pin
Support1239-Aug-06 23:11
Support1239-Aug-06 23:11 
Hi all,

I finally got it right to populate a listview with all the availible printers. I want to user to be able to say:
When there is a report to be printed use this printer,
When it is an invoice/slip use this printer.

So now i can display all the printers and have the user select it according to their needs. But i only have the names of the printers thanks to this code:

public void Main()
{
ManagementScope scope = new
ManagementScope(@"\root\cimv2");
scope.Connect();

ManagementObjectSearcher searcher = new
ManagementObjectSearcher("SELECT * FROM Win32_Printer");

lvPrinters.Items.Clear();

foreach (ManagementObject printer in searcher.Get())
{
// MessageBox.Show("Printer", Convert.ToString(printer["Name"]));
// Console.WriteLine(printer["Name"]);
ListViewItem _printeritem;
_printeritem = lvPrinters.Items.Add(Convert.ToString(printer["Name"]));
}
}

I want to know if having the name is enough or would i need the path of the printer aswell?
I want to be able to send a file, like pdf and html, directly to the printer that the user selected.

"Many of life's failures are people who did not realize how close they were to success when they gave up." Thomas A. Edison


-- modified at 5:47 Thursday 10th August, 2006
QuestionRe: users setting prefered printers Pin
Support12310-Aug-06 2:17
Support12310-Aug-06 2:17 
QuestionFind TreeNode in TreeView Pin
psamy9-Aug-06 23:08
psamy9-Aug-06 23:08 
AnswerRe: Find TreeNode in TreeView Pin
stancrm10-Aug-06 0:26
stancrm10-Aug-06 0:26 
QuestionWrite a command to modem Pin
mehrdadc489-Aug-06 23:01
mehrdadc489-Aug-06 23:01 
AnswerRe: Write a command to modem Pin
stancrm9-Aug-06 23:29
stancrm9-Aug-06 23:29 
QuestionVisual studio 2005 Pin
Sri harini9-Aug-06 22:50
Sri harini9-Aug-06 22:50 
AnswerRe: Visual studio 2005 Pin
eggsovereasy10-Aug-06 3:33
eggsovereasy10-Aug-06 3:33 
QuestionNUnit Exception: System.nullReferenceException Pin
Muhammad Chitrali9-Aug-06 22:32
Muhammad Chitrali9-Aug-06 22:32 
QuestionThank you Pin
minniemooo9-Aug-06 22:07
minniemooo9-Aug-06 22:07 
QuestionForeignKeyConstrait Pin
pirogramci9-Aug-06 22:05
pirogramci9-Aug-06 22:05 
QuestionInsert Query in SQlite Pin
aruna_koride9-Aug-06 21:51
aruna_koride9-Aug-06 21:51 
AnswerRe: Insert Query in SQlite Pin
pirogramci9-Aug-06 22:10
pirogramci9-Aug-06 22:10 
QuestionBitmap Color Space Conversion from RGB to CIE L*a*b Pin
Ibrah M9-Aug-06 21:37
Ibrah M9-Aug-06 21:37 
Questioncurious: combo loading speed Pin
V.9-Aug-06 21:19
professionalV.9-Aug-06 21:19 
AnswerRe: curious: combo loading speed Pin
Eric Dahlvang10-Aug-06 3:12
Eric Dahlvang10-Aug-06 3:12 
GeneralRe: curious: combo loading speed Pin
V.10-Aug-06 3:19
professionalV.10-Aug-06 3:19 
GeneralRe: curious: combo loading speed Pin
Eric Dahlvang10-Aug-06 4:50
Eric Dahlvang10-Aug-06 4:50 

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.