Get data from the Internet
Create a new userobject from standard class internetresult, call it n_cst_internet.
Declare this instance variable
string is_data
With that userobject type, you need to overload the internetdata function (which will be called by the PB VM automatically). The return type is integer and the parameter is data, its type is a blob.
[integer internetdata(blob data)]
is_data = string(data)
RETURN 1
Then from your script integer li_rc
inet linet_main
n_cst_internet luo_data // as defined above
linet_main = CREATE inet
luo_data = CREATE n_cst_internet
SetPointer(HourGlass!)
li_rc = &
linet_main.GetURL("http://www.rgagnon.com/classes/java-io.dat", luo_data)
SetPointer(Arrow!)
IF li_rc = 1 THEN
MessageBox("Data from Real's HowTo", luo_data.is_data)
ELSE
MessageBox("Data from Real's HowTo", "Oops rc:" + string(li_rc))
END IF
DESTROY luo_data
DESTROY linet_main
POSTing data maybe a little more tricky. You may need to set all the headers. string httprequest,ls_header
String ls_url,ls_headers
long ll_ret
long ll_length
Blob lblb_args
inet linet_main
n_cst_internet luo_data
linet_main = CREATE inet
luo_data = CREATE n_cst_internet
ls_url = "http://localhost/mypage.jsp"
lblb_args = blob("foo=bar")
ll_length = Len(lblb_args)
ls_headers = "Content-Type: " + &
"application/x-www-form-urlencoded~n" + &
"Content-Length: " + String( ll_length ) + "~n~n"
ll_ret = libet_main.PostURL(ls_url,lblb_args,ls_headers,8080,luo_data)
Declare this instance variable
string is_data
With that userobject type, you need to overload the internetdata function (which will be called by the PB VM automatically). The return type is integer and the parameter is data, its type is a blob.
[integer internetdata(blob data)]
is_data = string(data)
RETURN 1
Then from your script integer li_rc
inet linet_main
n_cst_internet luo_data // as defined above
linet_main = CREATE inet
luo_data = CREATE n_cst_internet
SetPointer(HourGlass!)
li_rc = &
linet_main.GetURL("http://www.rgagnon.com/classes/java-io.dat", luo_data)
SetPointer(Arrow!)
IF li_rc = 1 THEN
MessageBox("Data from Real's HowTo", luo_data.is_data)
ELSE
MessageBox("Data from Real's HowTo", "Oops rc:" + string(li_rc))
END IF
DESTROY luo_data
DESTROY linet_main
POSTing data maybe a little more tricky. You may need to set all the headers. string httprequest,ls_header
String ls_url,ls_headers
long ll_ret
long ll_length
Blob lblb_args
inet linet_main
n_cst_internet luo_data
linet_main = CREATE inet
luo_data = CREATE n_cst_internet
ls_url = "http://localhost/mypage.jsp"
lblb_args = blob("foo=bar")
ll_length = Len(lblb_args)
ls_headers = "Content-Type: " + &
"application/x-www-form-urlencoded~n" + &
"Content-Length: " + String( ll_length ) + "~n~n"
ll_ret = libet_main.PostURL(ls_url,lblb_args,ls_headers,8080,luo_data)
透明文本的实现
AutoCAD 快捷键




