在你的form中加ActiveX control, Microsoft Comunication Control,将对象取名例如为oCom
oCom.Init
This.commPort = 1 && RS232 COM#1
This.settings = "9600,n,8,1"
This.PortOpen=.T.
This.rthreshold= 1
This.InputLen=1
This.InputMode=0
oCom.OnComm
Thisform.Edit1.Value = rtrim(Thisform.Edit1.Value) +
This.Input