Hello
I have wrote code to get the default printer name using activex and when I run it in asp page it's showing me my machine default printer name in textbox as follow
I need to make the value of DefaultPrinter.text to be seted to my textbox1.text in my webform just when you load the application , and is it possible to save it to session
Regards
I have wrote code to get the default printer name using activex and when I run it in asp page it's showing me my machine default printer name in textbox as follow
Code:
Public Function MyPrinter()
Dim PrintData As Printer
Dim defprinterpos%
For Each PrintData In Printers
' Add printer name and port to list
lstPrinter.AddItem PrintData.DeviceName & " at: " & PrintData.Port
' Check for default printer
If PrintData.DeviceName = Printer.DeviceName Then defprinterpos = lstPrinter.NewIndex
Next
lstPrinter.ListIndex = defprinterpos%
DefaultPrinter .Text = Printer.DeviceName
End Function
I need to make the value of DefaultPrinter.text to be seted to my textbox1.text in my webform just when you load the application , and is it possible to save it to session
Regards