下面的VB腳本可以用Javascript來打開IP錢箱嗎?Winsock.SendData等效於Javascript?
Private Sub CashDrawerConnect_Click()
Winsock1.Close
ipaddr = "192.168.2.5"
Winsock1.RemoteHost = ipaddr
Winsock1.RemotePort = 30998
Winsock1.Connect
Sleep 250
TxtOpStatus = "Connection to the cash drawer at " & ipaddr & " is established..."
TxtOpStatus.Refresh
End Sub
Private Sub CashDrawerOpen_Click()
If Winsock1.State = sckConnected Then
Winsock1.SendData "opendrawer\0a"
Else
TxtOpStatus = "Not connected to the device"
TxtOpStatus.Refresh
End If
End Sub
您可以從.NET運行JavaScript(JScript) – 2013-03-16 00:56:16
嗯......實際上我想從iPad上的網絡應用程序運行這個功能,所以我猜Javascript已經不存在了。如果在本地網絡上有一臺php服務器,可以通過php來完成嗎? – 2013-03-16 00:59:51
@JasonWood是的,你可以這樣做,我編輯了我的答案來反映這一點。 – albertein 2013-03-16 01:04:46