Click here to Skip to main content
15,888,454 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: help Pin
habdul11-Sep-12 15:47
habdul11-Sep-12 15:47 
AnswerRe: help Pin
Dave Kreskowiak10-Sep-12 3:44
mveDave Kreskowiak10-Sep-12 3:44 
GeneralRe: help Pin
habdul11-Sep-12 15:49
habdul11-Sep-12 15:49 
AnswerRe: help Pin
Kenneth Haugland11-Sep-12 4:48
mvaKenneth Haugland11-Sep-12 4:48 
Questionprinter status Pin
wkalo8-Sep-12 1:22
wkalo8-Sep-12 1:22 
AnswerRe: printer status Pin
Eddy Vluggen8-Sep-12 4:52
professionalEddy Vluggen8-Sep-12 4:52 
GeneralRe: printer status Pin
wkalo8-Sep-12 20:45
wkalo8-Sep-12 20:45 
GeneralRe: printer status Pin
wkalo8-Sep-12 22:22
wkalo8-Sep-12 22:22 
The Below Routine Shows If Printer Is Online Or Not It Works Perfectly


Public Function IsPrinterOnline(ByVal printerName As String) As Boolean
Dim str As String = ""
Dim online As Boolean = False

'set the scope of this search to the local machine
Dim scope As New ManagementScope(ManagementPath.DefaultPath)
'connect to the machine
scope.Connect()

'query for the ManagementObjectSearcher
Dim query As New SelectQuery("select * from Win32_Printer")

Dim m As New ManagementClass("Win32_Printer")

Dim obj As New ManagementObjectSearcher(scope, query)

'get each instance from the ManagementObjectSearcher object
Using printers As ManagementObjectCollection = m.GetInstances()
'now loop through each printer instance returned
For Each printer As ManagementObject In printers
'first make sure we got something back
If printer IsNot Nothing Then
'get the current printer name in the loop
str = printer("Name").ToString().ToLower()

'check if it matches the name provided
If str.Equals(printerName.ToLower()) Then
MessageBox.Show(printer("PrinterStatus"))
'since we found a match check it's status
If printer("WorkOffline").ToString().ToLower().Equals("true") OrElse printer("PrinterStatus").Equals(7) Then
'it's offline

online = False
MessageBox.Show(str & " " & online)
Else
'it's online
online = True
End If
End If
Else
Throw New Exception("No printers were found")
End If
Next
End Using
Return online
End Function
wahid kalo

GeneralRe: printer status Pin
Eddy Vluggen9-Sep-12 6:29
professionalEddy Vluggen9-Sep-12 6:29 
QuestionUpdate previous date data and then update the rest of the data Pin
garyu877-Sep-12 22:22
garyu877-Sep-12 22:22 
AnswerRe: Update previous date data and then update the rest of the data Pin
David Mujica10-Sep-12 3:52
David Mujica10-Sep-12 3:52 
GeneralRe: Update previous date data and then update the rest of the data Pin
garyu8711-Sep-12 3:19
garyu8711-Sep-12 3:19 
GeneralRe: Update previous date data and then update the rest of the data Pin
David Mujica11-Sep-12 3:39
David Mujica11-Sep-12 3:39 
GeneralRe: Update previous date data and then update the rest of the data Pin
garyu8711-Sep-12 4:03
garyu8711-Sep-12 4:03 
Questionrelated dabase connectivity in vb6.0 Pin
sandy20506-Sep-12 18:28
sandy20506-Sep-12 18:28 
AnswerRe: related dabase connectivity in vb6.0 Pin
Eddy Vluggen6-Sep-12 18:36
professionalEddy Vluggen6-Sep-12 18:36 
QuestionVBA Script to update Active Directory Pin
DarrenAuchnie6-Sep-12 5:00
DarrenAuchnie6-Sep-12 5:00 
AnswerRe: VBA Script to update Active Directory Pin
Eddy Vluggen6-Sep-12 18:33
professionalEddy Vluggen6-Sep-12 18:33 
QuestionProblem With Datagridview Pin
sujuu6-Sep-12 0:39
sujuu6-Sep-12 0:39 
AnswerRe: Problem With Datagridview Pin
Eddy Vluggen6-Sep-12 18:31
professionalEddy Vluggen6-Sep-12 18:31 
Question.Net Control similar to Excel Text Wizard Pin
Member 77438055-Sep-12 14:54
Member 77438055-Sep-12 14:54 
AnswerRe: .Net Control similar to Excel Text Wizard Pin
Eddy Vluggen5-Sep-12 23:53
professionalEddy Vluggen5-Sep-12 23:53 
GeneralRe: .Net Control similar to Excel Text Wizard Pin
Member 77438056-Sep-12 2:32
Member 77438056-Sep-12 2:32 
GeneralRe: .Net Control similar to Excel Text Wizard Pin
Eddy Vluggen6-Sep-12 2:50
professionalEddy Vluggen6-Sep-12 2:50 
QuestionHow to Pass Parameter to Report Viewer ( vb.net 2010 ) ? Pin
sali224-Sep-12 20:58
sali224-Sep-12 20:58 

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.