Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Local & Network & Share Name Printers
Message
De
28/10/2004 09:14:39
Carl Dobson
Reference Point Computers
Overbury, Tewks, Royaume Uni
 
 
À
28/10/2004 07:58:22
Carl Dobson
Reference Point Computers
Overbury, Tewks, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Divers
Thread ID:
00955218
Message ID:
00955248
Vues:
22
Ok have just found the semi-solution to this - I can now seperate the Network from the Local Printers and display them accordingly. HOWEVER I still need to find the Share names of these Printers.
This is my code on how I got the printers & displayed them:

LOCAL lcpamount, lcprntname, ncount, lcprn
lcprntname = ""
lcPart1 = ""
lcPart2 = ""
lcNetwork = ""
lcLocal = ""
lcnetc = ""
lclocalc = ""
nline = 1

APRINTERS(aprnt) &&& Get list of Printers
lcpamount = ALEN(aprnt) &&& Find how many items in Array

FOR ncount = 1 TO lcpamount
lcprn = ALLTRIM(aprnt(ncount))
IF nline = 1
lcPart1 = ALLTRIM(lcprntname) +" " +ALLTRIM(lcprn)
nline = 2 &&& The next information will be Part 2 of the String
ELSE
IF LEFT(lcprn,1) = "\"
lcNetwork = lcPart1 + " Attached to " + lcprn +CHR(13) +CHR(10)
&&& Create a line feed & Carrage return
lcNetc = lcNetc + lcNetwork
&&& String for the Network information
ELSE
lcLocal = lcPart1 + " Attached to Port " + lcprn +CHR(13) +CHR(10)
&&& Create a line feed & Carrage return
lcLocalc = lcLocalc + lcLocal
&&& String for the Local information
ENDIF
nline = 1 &&& Go back to get part one of the string
ENDIF
ENDFOR

THISFORM.pageframe1.page2.edtPDIR.VALUE=ALLTRIM(lcLocalc) && Populate all Local Printers
THISFORM.pageframe1.page2.edtPNET.VALUE=ALLTRIM(lcNetc) && Populate all Network Printers

If anyone could help with finding the sharenames of the printers it would help allot.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform