Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: What is output Pin
Christian Graus13-Aug-07 8:17
protectorChristian Graus13-Aug-07 8:17 
AnswerRe: What is output Pin
Dan Neely13-Aug-07 8:49
Dan Neely13-Aug-07 8:49 
AnswerRe: What is output Pin
Luc Pattyn13-Aug-07 9:00
sitebuilderLuc Pattyn13-Aug-07 9:00 
AnswerRe: What is output Pin
m@u13-Aug-07 9:38
m@u13-Aug-07 9:38 
JokeRe: What is output Pin
Luc Pattyn13-Aug-07 9:52
sitebuilderLuc Pattyn13-Aug-07 9:52 
AnswerRe: What is output Pin
Ravi Bhavnani13-Aug-07 18:36
professionalRavi Bhavnani13-Aug-07 18:36 
Questionprint pdf file to network printer using printer IP address Pin
There is always the way to do it, but I don't know13-Aug-07 7:39
There is always the way to do it, but I don't know13-Aug-07 7:39 
AnswerRe: print pdf file to network printer using printer IP address Pin
Hessam Jalali13-Aug-07 9:03
Hessam Jalali13-Aug-07 9:03 
Each printer has a port for accessing that if you put the port name instead the printer name it would work.

ports for network printers define like this \\Hostname\portName [somewhat like printerName but not exactly] and you can put IP of the host instead of the name.

so you should do 2 things first find the printer port and second find the IP of the host

the first one need some works to do, one of the ways is to use WMI through System.Managment namespace in .NET

and here is the script you need for retrieving printers information

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("TITAN")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PrinterShare", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "Antecedent: " & objItem.Antecedent
      WScript.Echo "Dependent: " & objItem.Dependent
      WScript.Echo
   Next
Next


just use the query part to create and use it

Here is the code for showing the Printer ports

ManagementObjectSearcher search = new ManagementObjectSearcher(new SelectQuery("Win32_Printer"));
ManagementObjectCollection moc = search.Get();

foreach (ManagementObject mo in moc)
    MessageBox.Show(mo.Properties["Name"].Value.ToString()+"   Port:   "+mo.Properties["PortName"].Value.ToString());


and the second part is fairly easy just use the Dns.GetHostEntry method to get the IP


and at last I test your code with this method and it works

hope the post would be useful


Smile | :)
GeneralRe: print pdf file to network printer using printer IP address Pin
There is always the way to do it, but I don't know14-Aug-07 17:27
There is always the way to do it, but I don't know14-Aug-07 17:27 
GeneralRe: print pdf file to network printer using printer IP address Pin
Hessam Jalali16-Aug-07 20:23
Hessam Jalali16-Aug-07 20:23 
QuestionPainting Reversible Rectangle Pin
T.D.Prasad13-Aug-07 7:03
T.D.Prasad13-Aug-07 7:03 
AnswerRe: Painting Reversible Rectangle Pin
Christian Graus13-Aug-07 8:19
protectorChristian Graus13-Aug-07 8:19 
QuestionRe: Painting Reversible Rectangle Pin
T.D.Prasad13-Aug-07 8:37
T.D.Prasad13-Aug-07 8:37 
AnswerRe: Painting Reversible Rectangle Pin
Luc Pattyn13-Aug-07 8:51
sitebuilderLuc Pattyn13-Aug-07 8:51 
QuestionRe: Painting Reversible Rectangle Pin
T.D.Prasad13-Aug-07 9:02
T.D.Prasad13-Aug-07 9:02 
AnswerRe: Painting Reversible Rectangle Pin
Luc Pattyn13-Aug-07 9:14
sitebuilderLuc Pattyn13-Aug-07 9:14 
AnswerRe: Painting Reversible Rectangle Pin
Christian Graus13-Aug-07 8:55
protectorChristian Graus13-Aug-07 8:55 
QuestionRe: Painting Reversible Rectangle Pin
T.D.Prasad13-Aug-07 9:12
T.D.Prasad13-Aug-07 9:12 
QuestionHighlight Value on Tab Pin
Joemama6113-Aug-07 5:03
Joemama6113-Aug-07 5:03 
AnswerRe: Highlight Value on Tab Pin
Luc Pattyn13-Aug-07 5:38
sitebuilderLuc Pattyn13-Aug-07 5:38 
GeneralRe: Highlight Value on Tab Pin
Joemama6113-Aug-07 10:39
Joemama6113-Aug-07 10:39 
GeneralRe: Highlight Value on Tab Pin
Luc Pattyn13-Aug-07 10:52
sitebuilderLuc Pattyn13-Aug-07 10:52 
QuestionSQL connection timeout Pin
Demian Panello13-Aug-07 4:43
Demian Panello13-Aug-07 4:43 
AnswerRe: SQL connection timeout Pin
Justin Perez13-Aug-07 4:48
Justin Perez13-Aug-07 4:48 
GeneralRe: SQL connection timeout Pin
Demian Panello13-Aug-07 5:03
Demian Panello13-Aug-07 5:03 

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.