在网页和 VB 应用程序之间传递数据
我正在开发一个供我们公司内部使用的应用程序。该应用程序的目的是用于文档成像。我们想要做的是打印条形码标签以附加到文档上,以便在使用 vfiler 等软件扫描文档时能够读取条形码并知道如何归档它们。
主要焦点是我们基于网络(PHP)的 ERP 系统。我们希望修改代码,以允许用户在输入订单或采购订单后立即打印条形码标签。我可以访问 ERP 网页的源代码。我不知道有什么方法可以在不显示打印机选择对话框的情况下将网页打印到打印机。因此,我决定尝试创建一个 VB 应用程序来打印条形码。这将使我能够绕过打印机选择对话框。
现在回答这个问题。有没有办法让服务器上运行的网页(PHP)调用VB应用程序来执行任务?因此,如果我在网页上有一个按钮并且用户单击它,该按钮将以某种方式将相关信息(订单号)发送到 VB 应用程序,并且 VB 应用程序将打印条形码。 VB 应用程序将始终在计算机上运行。标签打印机将是每个人机器上的 Zebra USB 标签打印机。
任何想法表示赞赏。
谢谢, 基思
I am developing an application for internal use in our company. The purpose of this application is for document imaging. What we are wanting to do is print a barcode label to attach to documents so that when they are scanned in a piece of software such as vfiler will be able to read the barcodes and know how to file them.
The main focus is our ERP system which is web based (PHP). We are wanting to modify the code to allow the user to print the barcode label immediately once they enter an order or PO. I have access to the source code for the ERP web pages. I don't know of any way to make a web page print to a printer without displaying the printer select dialog. So, I decided that I wanted to try and create a VB application that would do the printing of the barcodes. This would allow me to bypass the the printer select dialog.
Now for the question. Is there any way to have a web page (PHP) running on the server call a VB app to perform a task? So, if I had a button on the webpage and the user clicked it, that button would somehow send the pertinent information (Order number) to the VB app and the VB app would print the barcode. The VB app will always be running on the machine. The label printers will be Zebra USB label printers on each person's machine.
Any thoughts appreciated.
Thanks,
Keith
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我实现这样的方法是拥有一个 Windows 服务,在与 Web 服务器不同的系统上运行,监视 Web 服务器上的上传文件夹,然后将文件移动到适当的位置以进行进一步处理。我通过在成功上传时创建初始记录来跟踪文件在系统中的移动,然后为每个活动创建交易记录(打印、传真、通过电子邮件发送、发送以供人工审核等)。这确保了每个文档的可报告审计跟踪,并帮助识别有时会发生的“孤立”文件。
对于此类服务,重要的是确保您已正确配置安全性,以便该服务可以访问打印机和网络驱动器等资源。
The way I implemented something like this was to have an Windows service, running on a different system from the webserver, watching the upload folders on the web server, then moving the files to the appropriate location for further processing. I tracked the movement of files through the system by creating an initial record upon a success upload, then creating a transaction record for each activity afterward (printed, faxed, emailed, sent for manual review, etc). This insured a reportaable audit trail for each document and helped identify 'orphan' files that would happen sometimes.
The important thing with a service like this is making sure that you've configured security properly so that the service has access to resources like printers and network drives.
您可以将 VB 应用程序设为服务,然后在特定文件夹上实现
FileSystemWatcher
。当用户单击“打印”按钮时,网页所做的就是将包含必要信息的文件保存到正在观看的文件夹中。You could make the VB app a service, then implement a
FileSystemWatcher
on a specific folder. When the user clicks the Print button, all the webpage does is save a file with the necessary info to the folder that is being watched.这似乎是一个老问题,但也许这个答案对其他人有帮助。使用命令行应用程序来实现这一点会容易得多。只需使用 PHP exec() 将必要的参数传递到 exe 文件中即可。
It seems an old question but maybe this answer would help someone else. It would be much easier to implement this with a command line app. Just pass the necessary parameters into the exe file with PHP exec().