Vb6 code to read network printer serial number and model
Asked 2 years, 8 months ago. Active 2 years, 8 months ago. Viewed 2k times. Object, ByVal e As System. EventArgs Handles Button1. Improve this question. StayOnTarget 9, 9 9 gold badges 43 43 silver badges 66 66 bronze badges.
What is specifically "functions that are not within the FTDI library"? The device requires a binary number number to be sent to it twice to work. Add a comment. Active Oldest Votes. Visual Basic's String variables are Unicode, so they are not suitable for handling binary data.
Based on the above, it will be as follows. Improve this answer. Thank you! When I put in Dim SendData nnn as Byte it says nnn is not declared, is it ok to put 3 in instead to specify a data size of 3? What is the purpose of the xxx and yyy? Also, when I specify SendData like you do there it says 'Value of type '1-dimensional array of byte cannot be converted to byte'.
Please replace with the length and value you actually use. And setting of the value may use CByte , CByte xxx. Thank you for all of your help. I am now successfully communicating with my external device. Programatically get Printer Serial Number Does anyone know of a way to connect to a printer through code to get info from it? Any ideas of where else to search? Why do you want the printer serial number anyway?
I've been programming with VB for 15 years. But I'm no expert, I'm still learning. Originally Posted by Keithuk. Replies: 2 Last Post: , AM.
Why do I have 85 of the exact same error with one module? Replies: 18 Last Post: , PM. Improve this question.
Aaron Brewer Aaron Brewer 3, 17 17 gold badges 45 45 silver badges 74 74 bronze badges. Any reason to not use WMI for this kind of information? If that is the case, then I can't really use that as a solution because I need to use this application on multiple machines. You will just need to include the System. Management Namespace. WMI is built into Windows. Show 1 more comment. Active Oldest Votes. Imports System.
Get MessageBox. ToString Next You can declare a string first if you would like and then set it to: info "serialnumber". Improve this answer. Thanks for this, and I am glad to see it worked for you. One of them being for "Imports System. Management", it gives me the error "Type 'ManagementObject' is not defined. You have to, not just the import. It is in my answer. Okay, I added the reference for System.
Management which removed all of the errors except one, which says that "Imports System. Management" is a syntax error.
NET if that makes a difference. Thank you so much! You tagged VB.
0コメント