如何用PB打开一个网页?

sanata 2009-05-22 11:29:26
如何用PB打开一个网页?
希望打开互联网上的网页的和打开本地的网页都说下~~谢谢拉~~
...全文
1815 31 打赏 收藏 转发到动态 举报
写回复
用AI写文章
31 条回复
切换为时间正序
请发表友善的回复…
发表回复
www_huabo 2009-06-24
  • 打赏
  • 举报
回复
请问怎样往静态文本框中写数据??
wy796143l 2009-06-14
  • 打赏
  • 举报
回复
[Quote=引用 8 楼 sdhylj 的回复:]

C/C++ code
Inet linet_base

this.GetContextService("Internet", linet_base)
linet_base.HyperlinkToURL("http://www.unix-center.net")
[/Quote]

又学一招,嘿嘿。
yan20010906 2009-06-12
  • 打赏
  • 举报
回复
长见识了
青锋-SS 2009-06-02
  • 打赏
  • 举报
回复
[Quote=引用 27 楼 K1933 的回复:]
太复杂了,来个简单的吧.
//==============================================================================
// 函数: uno_sys::of_open_url()
//------------------------------------------------------------------------------
// 描述: 经默认的浏览器打开相应的连接
//------------------------------------------------------------------------------
// 参数:
// value string as_url
//-------------------…
[/Quote]前面已经有了
K1933 2009-06-01
  • 打赏
  • 举报
回复
太复杂了,来个简单的吧.
//==============================================================================
// 函数: uno_sys::of_open_url()
//------------------------------------------------------------------------------
// 描述: 经默认的浏览器打开相应的连接
//------------------------------------------------------------------------------
// 参数:
// value string as_url
//------------------------------------------------------------------------------
// 返回值: integer
//------------------------------------------------------------------------------
// 作者: Ken Qin[kenqin@vip.163.com] 日期: 2007-10-17 10:07
//------------------------------------------------------------------------------
// 修改历史:
//
//------------------------------------------------------------------------------
// 利四达保留所有版权
//==============================================================================
Inet iinet_base
iinet_base = Create inet
GetContextService("Internet", iinet_base)
iinet_base.HyperlinkToURL('http://www.richta.com') //本地的也一样:http://127.0.0.1即可
Destroy iinet_base
l_chlmh 2009-05-31
  • 打赏
  • 举报
回复
这方面的例子很多,其实最简单的就是PB自带的控件:staticHyperLink,当然pb6.5上没有.
xiaoyehua 2009-05-31
  • 打赏
  • 举报
回复
比较有意思的东东,留个脚印,下次好找
iwangh 2009-05-30
  • 打赏
  • 举报
回复
up
bai_jiong 2009-05-30
  • 打赏
  • 举报
回复
先记下
bigpretty 2009-05-29
  • 打赏
  • 举报
回复
顶了
fnext 2009-05-29
  • 打赏
  • 举报
回复
路过看看
cammy168 2009-05-29
  • 打赏
  • 举报
回复
有点意思
圣殿骑士18 2009-05-28
  • 打赏
  • 举报
回复
有点意思
pbhase 2009-05-28
  • 打赏
  • 举报
回复
顶一下
qj_198127 2009-05-28
  • 打赏
  • 举报
回复
forward
global type w_maintain_preview from window
end type
type ole_web from olecustomcontrol within w_maintain_preview
end type
type cb_back from commandbutton within w_maintain_preview
end type
end forward

global type w_maintain_preview from window
integer width = 1650
integer height = 980
boolean titlebar = true
string title = "维修企业权限分配"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
windowstate windowstate = maximized!
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
ole_web ole_web
cb_back cb_back
end type
global w_maintain_preview w_maintain_preview

type variables

private:
string is_logName,is_passwd
boolean ib_loginDocument = true
boolean lb_true=true
end variables

event open;string ls_localIP
ls_localIP = message.stringparm

//ole_web.object.navigate(ls_localIP)
//setnull(ls_localIP)

//messagebox("ip","ewee")
select loginName,magcard into :is_logName,:is_passwd from lt_operator where id = :gl_operatorID ;

ole_web.object.navigate(ls_localIP)

end event

on w_maintain_preview.create
this.ole_web=create ole_web
this.cb_back=create cb_back
this.Control[]={this.ole_web,&
this.cb_back}
end on

on w_maintain_preview.destroy
destroy(this.ole_web)
destroy(this.cb_back)
end on

event resize;
long ll_space = 20

setRedraw(false)

ole_web.move(0,0)
ole_web.width = workspaceWidth() - 1
ole_web.height = workspaceHeight() - cb_back.height - 2*ll_space
ole_web.object.top = 0
ole_web.object.left = 0
ole_web.object.width = UnitsToPixels(workspaceWidth() - 1,XUnitsToPixels!)
ole_web.object.height = UnitsToPixels(workspaceHeight() - cb_back.height - 2*ll_space,YUnitsToPixels!)

cb_back.move(workspaceWidth() - ll_space - cb_back.width,workspaceHeight() - ll_space - cb_back.height)

setRedraw(true)
end event

type ole_web from olecustomcontrol within w_maintain_preview
event statustextchange ( string text )
event progresschange ( long progress, long progressmax )
event commandstatechange ( long command, boolean enable )
event downloadbegin ( )
event downloadcomplete ( )
event titlechange ( string text )
event propertychange ( string szproperty )
event beforenavigate2 ( oleobject pdisp, any url, any flags, any targetframename, any postdata, any headers, ref boolean cancel )
event newwindow2 ( ref oleobject ppdisp, ref boolean cancel )
event navigatecomplete2 ( oleobject pdisp, any url )
event documentcomplete ( oleobject pdisp, any url )
event onquit ( )
event onvisible ( boolean ocx_visible )
event ontoolbar ( boolean toolbar )
event onmenubar ( boolean menubar )
event onstatusbar ( boolean statusbar )
event onfullscreen ( boolean fullscreen )
event ontheatermode ( boolean theatermode )
event windowsetresizable ( boolean resizable )
event windowsetleft ( long left )
event windowsettop ( long top )
event windowsetwidth ( long ocx_width )
event windowsetheight ( long ocx_height )
event windowclosing ( boolean ischildwindow, ref boolean cancel )
event clienttohostwindow ( ref long cx, ref long cy )
event setsecurelockicon ( long securelockicon )
event filedownload ( ref boolean cancel )
event navigateerror ( oleobject pdisp, any url, any frame, any statuscode, ref boolean cancel )
event printtemplateinstantiation ( oleobject pdisp )
event printtemplateteardown ( oleobject pdisp )
event updatepagestatus ( oleobject pdisp, any npage, any fdone )
event privacyimpactedstatechange ( boolean bimpacted )
integer width = 1467
integer height = 560
integer taborder = 10
boolean border = false
borderstyle borderstyle = stylelowered!
boolean focusrectangle = false
string binarykey = "w_maintain_preview.win"
integer textsize = -10
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
long textcolor = 33554432
end type

event downloadcomplete();
//messagebox('',isnull(rte_1.object.Document))

end event

event documentcomplete(oleobject pdisp, any url);
if lb_true then
ole_web.object.document.form1.txtUser.innerText =is_logName
ole_web.object.document.form1.txtPassed.innerText =is_passwd
ole_web.object.document.form1.btnOk.click()
lb_true =false
end if
end event

type cb_back from commandbutton within w_maintain_preview
integer x = 1152
integer y = 680
integer width = 320
integer height = 100
integer taborder = 20
integer textsize = -12
integer weight = 400
fontcharset fontcharset = gb2312charset!
fontpitch fontpitch = variable!
string facename = "宋体"
string text = "返回(&B)"
end type

event clicked;
close(parent)
end event

WorldMobile 2009-05-28
  • 打赏
  • 举报
回复
比较有意思的东东,留个脚印,下次好找
Hello 0 1 2009-05-27
  • 打赏
  • 举报
回复
//声明函数
Function long ShellExecuteA(ulong hwnd,string lpOperation,string lpFile,string lpParameters,string lpDirectory,long nShowCmd)library"shell32.dll"

//
String ls_setnull
SetNull(ls_setnull)
ShellExecuteA(Handle(Parent),ls_setnull,"www.xt.e21.edu.cn",ls_setnull,ls_setnull,1)
dinsnurs 2009-05-27
  • 打赏
  • 举报
回复
FSDAFDF DFADFA
leef_zh 2009-05-27
  • 打赏
  • 举报
回复
PB取网页内容的方法2009-03-08 07:41以前以为PB不能做此类程序,今天在网上看到,赶紧收起来转发到BLOG上,以后可能用得上string ls_get_url, ls_args
string ls_response_text, ls_status_text
long ll_status_code
long ps1, ps2, ps3, ps4
string srstr1, srstr2
n_cst_string lhv_string
OleObject loo_xmlhttp
string ls_nj, ls_deptno, ls_deptname, ls_spenme, ls_temp1, ls_temp2, ls_temp3
long isel_total=0, row, row_spe, lii, lij, li_rs, li_rsdet

ls_nj = trim(ddlb_1.text)
if ls_nj='' then
messageboxx('提示','请先选择年级!', Information!, OK!, 1)
return
end if
if dw_dept.rowcount()<=0 then return

ls_get_url = "http://" + trim(sle_1.text)+"/newcsu/common/search/classresult1.aspx"

dw_special.reset()

for row=1 to dw_dept.rowcount()
if dw_dept.getitemnumber(row,'isel')=1 then
isel_total++
ls_deptno = trim(dw_dept.getitemstring(row,'院系代码'))
ls_deptname = trim(dw_dept.getitemstring(row,'院系名称'))
//ls_args = "grade=06级%20&deptId=03%20&deptName=资源加工与生物工程学院"
ls_args = "grade="+ls_nj+"%20&deptId="+ls_deptno+"%20&deptName="+ls_deptname

try
loo_xmlhttp = CREATE oleobject
loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.4.0")
loo_xmlhttp.open ("GET",ls_get_url + "?" + ls_args, false)
loo_xmlhttp.send()
//Get our response
ls_status_text = loo_xmlhttp.StatusText
ll_status_code = loo_xmlhttp.Status
//Check HTTP Response code for errors
if ll_status_code >= 300 then
messageboxx('提示','Web的GET请求失败!~r~n~r~n'+ls_response_text, Information!, OK!, 1)
else
//Get the response we received from the web server
ls_response_text = loo_xmlhttp.ResponseText
end if

srstr1 = ls_response_text
srstr2 = '~t</tr><tr style="color:#003399;background-color:White;">~r~n~t~t<td align="Center">'
ps1 = pos(ls_response_text, srstr2, 1)
if ps1=0 then continue
srstr1 = mid(ls_response_text, ps1+len(srstr2))
srstr1 = lhv_string.of_globalreplace(srstr1,srstr2, '')
srstr1 = lhv_string.of_globalreplace(srstr1,'</td><td align="Center">', '~t')
srstr1 = lhv_string.of_globalreplace(srstr1,'</td><td>', '~t')
srstr1 = lhv_string.of_globalreplace(srstr1,'</td>', '')
srstr1 = lhv_string.of_globalreplace(srstr1,'~t</tr>~r~n</table>~r~n~t~t~t</form>~r~n~t</body>~r~n</HTML>~r~n','')
//mle_1.text = srstr1

//Done so cleanup
loo_xmlhttp.DisconnectObject()

li_rs = long( f_fj_str(srstr1,'~r~n',0))
for lii=1 to li_rs
ls_temp1 = f_fj_str(srstr1,'~r~n',lii )
ls_temp2 = f_fj_str(ls_temp1, '~t', 1 )
ls_spenme = ls_temp2
ls_temp2 = f_fj_str(ls_temp1, '~t', 3 )
ls_temp2 = mid(ls_temp2,2) + '/'
li_rsdet = long(f_fj_str(ls_temp2,'/',0))
for lij=1 to li_rsdet
ls_temp3 = trim (f_fj_str(ls_temp2,'/',lij))
row_spe = dw_special.insertrow(0)
dw_special.setitem(row_spe,'isel', 1)
dw_special.setitem(row_spe,'zy', ls_spenme)
dw_special.setitem(row_spe,'bj', ls_temp3)
dw_special.setitem(row_spe,'yx', ls_deptname)
next
next
if dw_special.rowcount()>0 then
cb_getxs.enabled = true
else
cb_getxs.enabled = false
end if

catch (RuntimeError rte)
messageboxx('运行时错', rte.getMessage(), Information!, OK!, 1)
return
end try

end if
next

if isel_total=0 then
messageboxx('提示','请先选择院系!', Information!, OK!, 1)
return
end if
---------

http://hi.baidu.com/wangchao%5Fcn/blog/item/ec571ad1baf3aa309a5027f2.html

复制过来的,我没试过~~
jiuyue594062902 2009-05-27
  • 打赏
  • 举报
回复
我现在非常需要 频率可调的方波发生器的资料(汇编的) 但是积分不足 星期天就要交作业了 自己也努力过了 好心人帮帮忙 我q 594062902
加载更多回复(11)

740

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 脚本语言
社区管理员
  • 脚本语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧