Results 1 to 8 of 8

Thread: How to locate a network printer

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    Question How to locate a network printer

    How to locate a network printer ? so PHP script that execute this module can print the documents ?
    thx in advance

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: How to locate a network printer

    That can't be done with PHP. All you can do is prodivde a button in HTML that displays the print dialog.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: How to locate a network printer

    Quote Originally Posted by fella_amore
    How to locate a network printer ? so PHP script that execute this module can print the documents ?
    thx in advance
    I have, give or take the odd doubt, absolutely no idea what you are talking about. Perhaps you could repeat your query with an increased level of depth and verbosity so that we can better assist.

  4. #4

    Thread Starter
    New Member
    Join Date
    Mar 2006
    Posts
    2

    Re: How to locate a network printer

    I'm sorry about my previous post...i'm just looking for a solution to find a network printer using VB function thx

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to locate a network printer

    Even if it is a network printer, I believe you still have to have it installed on your PC before you can use it.

    That being said, listing out what printers are installed on your PC with VB is very easy.

  6. #6
    Lively Member darktown's Avatar
    Join Date
    Apr 2006
    Posts
    85

    Re: How to locate a network printer

    Can't you send some kind of signal to all your network devices and when you get a specific response that you are able to distinguish printers from computers and so on?..

    Must be possible I think but how?

    Find a router, send a broadcast and see what happens? something like it?
    There is an easy way, there is a hard way and there is My way of doing things!

  7. #7
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: How to locate a network printer

    Quote Originally Posted by darktown
    Can't you send some kind of signal to all your network devices and when you get a specific response that you are able to distinguish printers from computers and so on?..
    And to kill a mosquito, burn the house down. You could end up transferring many thousands of packets in a large network. Network admins frown on that kind of promiscuity.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  8. #8
    New Member
    Join Date
    May 2006
    Posts
    7

    Re: How to locate a network printer

    I tend to agree with what was said on network traffic usage. You would be better off if you keep a list of the network printers available in a file (stored centrally) and you then reference that file if you want to present a list of printers to the user.

    You can then periodically (say once every week) update the central file.

    You can get a list of network printers programatically, but this depends on what type of printers you have installed. If the network printers have an IP address and your IP range is say 10.10.0.1 to 10.10.0.100, and the printers use a standard print server type of connection, for each IP you can try and connect to the printer on port 9100 using the winsock component.

    If the printers you have are shared under windows, you need to first get a list of PC/PrintServer names from your network using the net view command and placing the contents in a text file. Then, read the text file and for each PC/PrintServer entry, run net view PrintServer >>prninfo.txt. You can sieve prninfo.txt file to find what printers are shared.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width