亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 編程 > .NET > 正文

如何調用NetMessageBufferSend發送消息?(改編)

2024-07-21 02:06:05
字體:
來源:轉載
供稿:網友



如何調用netmessagebuffersend發送消息?

問題描述:

如何調用winnt/2k/xp下的api函數netmessagebuffersend模擬net send命令來發送消息?

解決方案:

下面代碼已測試成功,直接導入pbl即可

 

$pbexportheader$w_main.srw

forward

global type w_main from window

end type

type mle_1 from multilineedit within w_main

end type

type cb_1 from commandbutton within w_main

end type

type sle_1 from singlelineedit within w_main

end type

type st_2 from statictext within w_main

end type

type st_1 from statictext within w_main

end type

end forward

 

type icmp_echo_reply from structure

    unsignedlong        address

    unsignedlong        status

    unsignedlong        roundtriptime

    unsignedlong        datasize

    unsignedlong        reserved[3]

    character       data[250]

end type

global type w_main from window

int x=1056

int y=484

int width=1531

int height=1152

boolean titlebar=true

string title="netmessagesend"

long backcolor=80269524

boolean controlmenu=true

boolean minbox=true

boolean resizable=true

mle_1 mle_1

cb_1 cb_1

sle_1 sle_1

st_2 st_2

st_1 st_1

end type

global w_main w_main

 

type prototypes

function ulong netmessagebuffersend(ulong servername, ref char msgname[],ulong fromname, ref char buf[], ulong buflen) library "netapi32.dll" alias for "netmessagebuffersend"

function ulong icmpcreatefile () library "icmp.dll"

function long icmpsendecho (ulong icmphandle, ulong destinationaddress, string requestdata,long requestsize, long requestoptions, ref icmp_echo_reply replybuffer, long replysize, long timeout ) library "icmp.dll" alias for "icmpsendecho"

function long icmpclosehandle (ulong icmphandle) library "icmp.dll"

function ulong inet_addr (string cp) library "ws2_32.dll" alias for "inet_addr"

end prototypes

type variables

constant ulong nerr_success = 0

end variables

forward prototypes

public subroutine wf_string_to_unicode (string as_string, ref character ac_unicode[])

public subroutine wf_string_to_unicode (string as_string, ref character ac_unicode[])

public function boolean wf_netmessagebuffersend (string as_sendto, string as_msgtext)

public function boolean wf_ping (string as_ipaddress, string as_echomsg)

end prototypes

 

public subroutine wf_string_to_unicode (string as_string, ref character ac_unicode[]);integer li_loop, li_len, li_uni

 

li_len = len(as_string)

 

for li_loop = 1 to li_len

    li_uni = li_uni + 1

    ac_unicode[li_uni] = mid(as_string, li_loop, 1)

    li_uni = li_uni + 1

    ac_unicode[li_uni] = char(0)

next

 

li_uni = li_uni + 1

ac_unicode[li_uni] = char(0)

li_uni = li_uni + 1

ac_unicode[li_uni] = char(0)

 

end subroutine

public function boolean wf_netmessagebuffersend (string as_sendto, string as_msgtext);ulong lul_result, lul_buflen

char lc_msgname[],lc_msgtext[]

 

wf_string_to_unicode(as_sendto, lc_msgname)

wf_string_to_unicode(as_msgtext, lc_msgtext)

 

lul_buflen = upperbound(lc_msgtext)

 

lul_result = netmessagebuffersend(0, lc_msgname,0, lc_msgtext, lul_buflen)

 

if lul_result = nerr_success then

    return true

else

    return false

end if

end function

public function boolean wf_ping (string as_ipaddress, string as_echomsg);ulong lul_address, lul_handle

long ll_rc, ll_size

string ls_reply

icmp_echo_reply lstr_reply

 

lul_address = inet_addr(as_ipaddress)

if lul_address > 0 then

    lul_handle = icmpcreatefile()

    ll_size = len(as_echomsg)

    ll_rc = icmpsendecho(lul_handle, lul_address, &

                        as_echomsg, ll_size, 0, &

                        lstr_reply, 278, 200)

    icmpclosehandle(lul_handle)

    if ll_rc <> 0 then

        if lstr_reply.status = 0 then

            ls_reply = string(lstr_reply.data)

            if ls_reply = as_echomsg then

                return true

            end if

        end if

    end if

end if

 

return false

 

end function

on w_main.create

this.mle_1=create mle_1

this.cb_1=create cb_1

this.sle_1=create sle_1

this.st_2=create st_2

this.st_1=create st_1

this.control[]={this.mle_1,&

this.cb_1,&

this.sle_1,&

this.st_2,&

this.st_1}

end on

 

on w_main.destroy

destroy(this.mle_1)

destroy(this.cb_1)

destroy(this.sle_1)

destroy(this.st_2)

destroy(this.st_1)

end on

 

type mle_1 from multilineedit within w_main

int x=27

int y=264

int width=1399

int height=604

int taborder=20

borderstyle borderstyle=stylelowered!

long textcolor=33554432

int textsize=-10

int weight=400

string facename="方正姚體"

fontcharset fontcharset=gb2312charset!

fontpitch fontpitch=variable!

end type

 

type cb_1 from commandbutton within w_main

int x=1070

int y=904

int width=357

int height=108

int taborder=30

string text=" 發送(&s)"

int textsize=-10

int weight=400

string facename="方正姚體"

fontcharset fontcharset=gb2312charset!

fontpitch fontpitch=variable!

end type

 

event clicked;if not wf_ping(trim(sle_1.text),"") then

    messagebox("提示","指定目標地址不存在或不通!")

    return

end if

 

if wf_netmessagebuffersend(trim(sle_1.text),trim(mle_1.text)) then

   messagebox("提示","發送成功!")

else

   messagebox("提示","發送失敗!")  

end if

end event

type sle_1 from singlelineedit within w_main

int x=430

int y=48

int width=997

int height=92

int taborder=10

borderstyle borderstyle=stylelowered!

boolean autohscroll=false

long textcolor=33554432

int textsize=-10

int weight=400

string facename="方正姚體"

fontcharset fontcharset=gb2312charset!

fontpitch fontpitch=variable!

end type

 

type st_2 from statictext within w_main

int x=14

int y=172

int width=379

int height=76

boolean enabled=false

string text="發送內容:"

boolean focusrectangle=false

long textcolor=33554432

long backcolor=67108864

int textsize=-10

int weight=400

string facename="方正姚體"

fontcharset fontcharset=gb2312charset!

fontpitch fontpitch=variable!

end type

 

type st_1 from statictext within w_main

int x=14

int y=52

int width=379

int height=76

boolean enabled=false

string text="目標地址:"

boolean focusrectangle=false

long textcolor=33554432

long backcolor=67108864

int textsize=-10

int weight=400

string facename="方正姚體"

fontcharset fontcharset=gb2312charset!

fontpitch fontpitch=variable!

end type

 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
国产精品88a∨| 日韩福利视频在线观看| 久久久免费在线观看| 欧美日韩一区免费| 成人福利网站在线观看| 久久青草精品视频免费观看| 亚洲一区亚洲二区| 欧美激情一级二级| 91精品国产综合久久香蕉922| 久久精品99久久香蕉国产色戒| 久久婷婷国产麻豆91天堂| 久久777国产线看观看精品| 午夜精品www| 国产精品爽爽爽| 国产精品免费小视频| 中文字幕在线精品| 国产精品亚洲片夜色在线| 欧美中文字幕在线视频| 最近的2019中文字幕免费一页| 国产精品露脸自拍| 国产自产女人91一区在线观看| 欧美激情精品久久久久久变态| 亚洲欧美日韩成人| 国产97免费视| 97精品伊人久久久大香线蕉| 久久人人爽人人爽人人片亚洲| 国产精品第一第二| 亚洲视频网站在线观看| 欧美一区二区视频97| 欧美精品18videos性欧美| 欧美亚洲国产精品| 亚洲老头同性xxxxx| 亚洲精品suv精品一区二区| 国产在线观看精品| 亚洲精品久久久久久久久久久久| 国产视频欧美视频| 欧美一区在线直播| xxxx欧美18另类的高清| 久久精视频免费在线久久完整在线看| 午夜精品久久久久久久99热浪潮| 麻豆精品精华液| 精品成人国产在线观看男人呻吟| 国产精品com| 一区二区三区在线播放欧美| 久热爱精品视频线路一| 亚洲欧美日韩中文在线| 欧美一级高清免费| 欧美激情视频一区二区三区不卡| 91久久中文字幕| 亚洲视频国产视频| 亚洲精品久久视频| 成人写真视频福利网| 国产精品爱啪在线线免费观看| 日韩中文字幕精品| 中文在线不卡视频| 亚洲色图15p| 97国产精品久久| 欧美亚洲成人网| 影音先锋欧美在线资源| 亚洲成人精品久久久| 亚洲国产天堂久久综合| www日韩中文字幕在线看| 综合网中文字幕| 亚洲国产小视频在线观看| 日韩美女在线播放| 91影院在线免费观看视频| 国产日韩欧美在线视频观看| 亚洲精品网站在线播放gif| 九九热最新视频//这里只有精品| 国产精品户外野外| 亚洲毛片一区二区| 精品视频偷偷看在线观看| 国产成人精品在线视频| 欧美激情在线一区| 日韩成人激情影院| 欧美精品在线观看91| 国产精品免费小视频| 日韩中文字幕第一页| 亚洲xxxxx电影| 欧美大学生性色视频| 亚洲欧美中文字幕在线一区| 91精品国产91久久久久久吃药| 欧美大人香蕉在线| 国产精品三级久久久久久电影| 日本欧美精品在线| 久久国内精品一国内精品| 日韩精品在线影院| 欧美剧在线观看| 精品视频9999| 久久久久久久一区二区三区| 欧美大胆在线视频| 成人黄色中文字幕| 国产精品直播网红| 精品国内产的精品视频在线观看| 欧美怡春院一区二区三区| 久久免费观看视频| 国产精品男女猛烈高潮激情| 日韩国产高清视频在线| 国产原创欧美精品| 国产精品视频一区二区高潮| 欧美另类老肥妇| 91精品免费视频| 亚洲免费视频一区二区| 欧美性生活大片免费观看网址| 黑人巨大精品欧美一区免费视频| 裸体女人亚洲精品一区| 久久视频中文字幕| 亚洲三级免费看| 国产精品久久久久久久久久久新郎| 亚洲综合日韩在线| 高清亚洲成在人网站天堂| 亚洲人成电影网站色www| 日韩成人av一区| 国产精品吴梦梦| 米奇精品一区二区三区在线观看| 欧美精品日韩三级| 国产色婷婷国产综合在线理论片a| 国产精品极品尤物在线观看| 国产99久久精品一区二区 夜夜躁日日躁| 91影院在线免费观看视频| 亚洲国产成人精品女人久久久| 日韩精品日韩在线观看| 欧美另类xxx| 欧美精品在线极品| 欧美乱大交做爰xxxⅹ性3| 亚洲高清色综合| 国产精品美女呻吟| 国产一区二区三区在线视频| 在线成人免费网站| 日韩成人在线视频观看| 成人性教育视频在线观看| 正在播放亚洲1区| 久久777国产线看观看精品| 国产亚洲精品久久久久久| 精品无人区乱码1区2区3区在线| 亚洲国产一区二区三区四区| 亚洲成人精品视频在线观看| 亚洲人永久免费| 国产精品99久久久久久久久久久久| 中文字幕成人在线| 久久免费在线观看| 日韩视频在线免费观看| 91超碰中文字幕久久精品| 亚洲精品永久免费| 国产精品一区电影| 欧美成人亚洲成人日韩成人| 亚洲伊人一本大道中文字幕| 亚洲欧美国产制服动漫| 亚洲成年网站在线观看| 欧美亚洲国产视频| 国产一区二区精品丝袜| 91超碰中文字幕久久精品| 在线观看视频99| 中国china体内裑精亚洲片| 欧美午夜www高清视频| 成人免费网站在线观看| 亚洲精品www| 精品福利樱桃av导航| 亚洲男女性事视频| 久久精品99无色码中文字幕| 超碰精品一区二区三区乱码| 国产欧美中文字幕| 国产精品扒开腿做爽爽爽男男| 欧美激情一级欧美精品|