Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can Web Application access local printers info?
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
MVC
Versions des environnements
Environment:
C# 5.0
OS:
Windows 10
Database:
MS SQL Server
Divers
Thread ID:
01634865
Message ID:
01634868
Vues:
36
>Hi everybody,
>
>I did a very quick google search and the answer seems to be no, but I thought it would not hurt to ask.
>
>We're re-writing an existing VFP desktop app into MVC web application.
>
>The VFP app had ability to choose preferred local printer from the aPrinters array.
>
>Should we just allow someone to type anything in that column without any validation since it's a web app?
>
>Thanks in advance.

It may be a stretch, but this is what I found to get the default printer, which of course works only in Windows environment and if ActiveX is enabled:
<SCRIPT type="text/javascript" LANGUAGE="JavaScript">
function GetDefaultPrinter(inputparms)
{
// Instantiate the Shell object and invoke 
// its execute method.

var oShell = new ActiveXObject("WScript.Shell"); 

sRegVal = 'HKEY_CURRENT_USER\\Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows\\Device'
sDefault = ""

sDefault = oShell.RegRead(sRegVal)
}
Christian Isberner
Software Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform