none
Release Pos printer while catch PosControlException

    คำถาม

  • Dear All,

             Please have a look at the following code. Can I release the printer while PosControlException occurs? What will happen if I do that?

    Dim posExplorer As New PosExplorer()
    Dim deviceInfo As DeviceInfo = Nothing
    deviceInfo = posExplorer.GetDevice(DeviceType.PosPrinter, PrinterName)
    pr = posExplorer.CreateInstance(deviceInfo)   
    pr.Open()
    Try   
    	pr.Claim(10000)
    Catch e As PosControlException
    	Try
    		pr.Release()
    	Catch ex As Exception
    		Throw e
    	End Try
    	Throw e
    Catch e As Exception
    ....
    End Try
    Thanks
    26 กุมภาพันธ์ 2555 6:59

ตอบทั้งหมด