使用PB開發(fā)網(wǎng)絡(luò)版的來電管理軟件 |
chen在2007/8/5發(fā)表,被瀏覽6245次
|
適合對(duì)象:記得來電顯示管理器的網(wǎng)絡(luò)版 開發(fā)環(huán)境:PowerBuilder 下載范例:JDDemo2.pbl.zip 使用環(huán)境:需要來電監(jiān)聽服務(wù)程序TeleListen.exe(點(diǎn)擊下載) 相關(guān)連接:來電管理器服務(wù)程序
 注意:采用Socket網(wǎng)絡(luò)技術(shù),需要使用ActiveX控件MSWINSCK.OCX 方法:選擇“Insert”-〉“Control”-〉“OLE...”-〉“Insert Object”-〉“Insert Control”-〉“Microsoft WinSock Control”
?Generated Application Objectforward global type jddemo2 from application end type global transaction sqlca global dynamicdescriptionarea sqlda global dynamicstagingarea sqlsa global error error global message message end forward global type jddemo2 from application string appname = "jddemo2" string displayname = "來電顯示客戶端" end type global jddemo2 jddemo2 on jddemo2.create appname="jddemo2" message=create message sqlca=create transaction sqlda=create dynamicdescriptionarea sqlsa=create dynamicstagingarea error=create error end on on jddemo2.destroy destroy(sqlca) destroy(sqlda) destroy(sqlsa) destroy(error) destroy(message) end on event open;Open(Form2) end event
?來電顯示客戶端 forward global type form2 from window end type type cb_2 from commandbutton within form2 end type type cb_1 from commandbutton within form2 end type type sle_2 from singlelineedit within form2 end type type st_2 from statictext within form2 end type type st_1 from statictext within form2 end type type sle_1 from singlelineedit within form2 end type type lb_1 from listbox within form2 end type type ole_1 from olecustomcontrol within form2 end type end forward global type form2 from window integer width = 1609 integer height = 1048 boolean titlebar = true string title = "來電顯示客戶端" boolean controlmenu = true boolean minbox = true boolean maxbox = true boolean resizable = true long backcolor = 67108864 cb_2 cb_2 cb_1 cb_1 sle_2 sle_2 st_2 st_2 st_1 st_1 sle_1 sle_1 lb_1 lb_1 ole_1 ole_1 end type global form2 form2 on form2.create this.cb_2=create cb_2 this.cb_1=create cb_1 this.sle_2=create sle_2 this.st_2=create st_2 this.st_1=create st_1 this.sle_1=create sle_1 this.lb_1=create lb_1 this.ole_1=create ole_1 this.Control[]={this.cb_2,& this.cb_1,& this.sle_2,& this.st_2,& this.st_1,& this.sle_1,& this.lb_1,& this.ole_1} end on on form2.destroy destroy(this.cb_2) destroy(this.cb_1) destroy(this.sle_2) destroy(this.st_2) destroy(this.st_1) destroy(this.sle_1) destroy(this.lb_1) destroy(this.ole_1) end on type cb_2 from commandbutton within form2 integer x = 1125 integer y = 708 integer width = 402 integer height = 112 integer taborder = 30 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "關(guān)閉" end type event clicked; ole_1.Object.Close() lb_1.AddItem("已關(guān)閉連接") end event type cb_1 from commandbutton within form2 integer x = 1125 integer y = 556 integer width = 402 integer height = 112 integer taborder = 20 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" string text = "連接" end type event clicked; ole_1.Object.RemoteHost = sle_1.Text ole_1.Object.RemotePort = Integer(sle_2.Text) ole_1.Object.Connect() end event type sle_2 from singlelineedit within form2 integer x = 1129 integer y = 376 integer width = 402 integer height = 112 integer taborder = 30 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 string text = "3825" borderstyle borderstyle = stylelowered! end type type st_2 from statictext within form2 integer x = 1138 integer y = 300 integer width = 402 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "Socket端口" boolean focusrectangle = false end type type st_1 from statictext within form2 integer x = 1129 integer y = 44 integer width = 402 integer height = 64 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 long backcolor = 67108864 string text = "服務(wù)器地址" boolean focusrectangle = false end type type sle_1 from singlelineedit within form2 integer x = 1129 integer y = 124 integer width = 402 integer height = 112 integer taborder = 20 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 string text = "127.0.0.1" borderstyle borderstyle = stylelowered! end type type lb_1 from listbox within form2 integer x = 37 integer y = 44 integer width = 1019 integer height = 792 integer taborder = 10 integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 boolean sorted = false borderstyle borderstyle = stylelowered! end type type ole_1 from olecustomcontrol within form2 event ocx_error ( integer number, string description, long scode, string source, string helpfile, long helpcontext, boolean canceldisplay ) event dataarrival ( long bytestotal ) event ocx_connect ( ) event connectionrequest ( long requestid ) event ocx_close ( ) event sendprogress ( long bytessent, long bytesremaining ) event sendcomplete ( ) integer x = 1408 integer y = 860 integer width = 128 integer height = 112 integer taborder = 10 borderstyle borderstyle = stylelowered! boolean focusrectangle = false string binarykey = "form2.win" integer textsize = -10 integer weight = 400 fontcharset fontcharset = ansi! fontpitch fontpitch = variable! fontfamily fontfamily = swiss! string facename = "Arial" long textcolor = 33554432 end type event dataarrival; String s Integer p ole_1.Object.GetData(ref s) If Left(s, 1) = "#" Then p = Pos(s, " ") lb_1.AddItem("來電號(hào)碼: " + Mid(s, 2, p - 2)) lb_1.AddItem("來電時(shí)間: " + Mid(s, p + 1, 19)) else lb_1.AddItem(s) End If end event event ocx_connect; lb_1.Reset() lb_1.AddItem("連接成功") end event
|
|
|
|