TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jesper
NA
89
54.4k
I need the exact name of the printdriver, but i get a wrong
Jan 9 2013 2:24 PM
Hi
i have this code:
public void comboFillPrinterDrivers()
{
try
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PrinterDriver");
foreach (ManagementObject queryObj in searcher.Get())
{
listPrinterDriver.Add(queryObj["Name"]);
}
}
catch (ManagementException ef)
{
MessageBox.Show("An error occurred while querying for WMI data: " + ef.Message);
}
comboDriver.DataSource = listPrinterDriver.Distinct().ToList();
}
This peace of code print out the installed printer drivers i this format:
HP Universal Printing PCL 6,3,Windows x64
i need it, to be:
HP Universal Printing PCL 6
without
,3,Windows x64
Is ther any way to trim it off, its always like that, with any drivers
:)
Reply
Answers (
4
)
Generating Invoice with three identical copies
Print Combobox and Listbox items to Printer