两个问题,高手请进

hiyo 2004-12-14 05:05:10
1、如何用代码实现类似win98中WinPopup软件所提供的信使服务功能;
2、如何获取网上邻居中各个计算机名;
谢谢。
...全文
92 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hiyo 2004-12-20
  • 打赏
  • 举报
回复
to oyljerry:请将netBIOS的用法简述一二好吗?
to changechange:直接写数据到一个共享数据库如何实现呢?请赐教。
sb56 2004-12-19
  • 打赏
  • 举报
回复
win98下失败的原因在于netapi32.dll连接库与win2000以上版本接口不同.
hiyo 2004-12-17
  • 打赏
  • 举报
回复
两为高手哪里去了?
hiyo 2004-12-16
  • 打赏
  • 举报
回复
to oyljerry:请将netBIOS的用法简述一二好吗?
to changechange:直接写数据到一个共享数据库如何实现呢?请赐教。
oyljerry 2004-12-15
  • 打赏
  • 举报
回复
98下,用netbios实现
hiyo 2004-12-15
  • 打赏
  • 举报
回复
谢谢! 对于第1个问题可以使用shell调用net send命令或使用API函数NetMessageBufferSend Lib "NETAPI32.DLL" (Server As Any, yToName As Byte, yFromName As Any, yMsg As Byte, ByVal lSize As Long) As Long 在win2000及winXP中可以实现,但对于win9x操作系统无效,如何解决这个问题呢?
changechange 2004-12-15
  • 打赏
  • 举报
回复
获取网上邻居里的计算机名
获取网上邻居里的计算机名
这是转自以前网友的贴,我也忘记是谁写的了,我自已没测试过。
option explicit
private const resource_connected as long = &h1&
private const resource_globalnet as long = &h2&
private const resource_remembered as long = &h3&

private const resourcedisplaytype_directory& = &h9
private const resourcedisplaytype_domain& = &h1
private const resourcedisplaytype_file& = &h4
private const resourcedisplaytype_generic& = &h0
private const resourcedisplaytype_group& = &h5
private const resourcedisplaytype_network& = &h6
private const resourcedisplaytype_root& = &h7
private const resourcedisplaytype_server& = &h2
private const resourcedisplaytype_share& = &h3
private const resourcedisplaytype_shareadmin& = &h8
private const resourcetype_any as long = &h0&
private const resourcetype_disk as long = &h1&
private const resourcetype_print as long = &h2&
private const resourcetype_unknown as long = &hffff&
private const resourceusage_all as long = &h0&
private const resourceusage_connectable as long = &h1&
private const resourceusage_container as long = &h2&
private const resourceusage_reserved as long = &h80000000
private const no_error = 0
private const error_more_data = 234 'l // dderror
private const resource_enum_all as long = &hffff
private type netresource
dwscope as long
dwtype as long
dwdisplaytype as long
dwusage as long
plocalname as long
premotename as long
pcomment as long
pprovider as long
end type
private type netresource_real
dwscope as long
dwtype as long
dwdisplaytype as long
dwusage as long
slocalname as string
sremotename as string
scomment as string
sprovider as string
end type
private declare function wnetaddconnection2 lib "mpr.dll" alias "wnetaddconnection2a" (lpnetresource as netresource, byval lppassword as string, byval lpusername as string, byval dwflags as long) as long
private declare function wnetopenenum lib "mpr.dll" alias "wnetopenenuma" (byval dwscope as long, byval dwtype as long, byval dwusage as long, lpnetresource as any, lphenum as long) as long
private declare function wnetenumresource lib "mpr.dll" alias "wnetenumresourcea" (byval henum as long, lpccount as long, lpbuffer as netresource, lpbuffersize as long) as long
private declare function wnetcloseenum lib "mpr.dll" (byval henum as long) as long
private declare function varptrany lib "vb40032.dll" alias "varptr" (lpobject as any) as long
private declare sub copymem lib "kernel32" alias "rtlmovememory" (lpto as any, lpfrom as any, byval llen as long)
private declare sub copymembyptr lib "kernel32" alias "rtlmovememory" (byval lpto as long, byval lpfrom as long, byval llen as long)
private declare function lstrcpy lib "kernel32" alias "lstrcpya" (byval lpstring1 as string, byval lpstring2 as any) as long
private declare function lstrlen lib "kernel32" alias "lstrlena" (byval lpstring as any) as long
sub main()
const max_resources = 256
const not_a_container = -1

dim bfirsttime as boolean
dim lreturn as long
dim henum as long
dim lcount as long
dim lmin as long
dim llength as long
dim l as long
dim lbuffersize as long
dim llastindex as long
dim unetapi(0 to max_resources) as netresource
dim unet() as netresource_real
bfirsttime = true
do
if bfirsttime then
lreturn = wnetopenenum(resource_globalnet, resourcetype_any, resourceusage_all, byval 0&, henum)
bfirsttime = false
else
if unet(llastindex).dwusage and resourceusage_container then
lreturn = wnetopenenum(resource_globalnet, resourcetype_any, resourceusage_all, unet(llastindex), henum)
else
lreturn = not_a_container
henum = 0
end if
llastindex = llastindex 1
end if
if lreturn = no_error then
lcount = resource_enum_all
do
lbuffersize = ubound(unetapi) * len(unetapi(0)) / 2
lreturn = wnetenumresource(henum, lcount, unetapi(0), lbuffersize)
if lcount > 0 then
redim preserve unet(0 to lmin lcount - 1) as netresource_real
for l = 0 to lcount - 1
'each resource will appear here as unet(i)
unet(lmin l).dwscope = unetapi(l).dwscope
unet(lmin l).dwtype = unetapi(l).dwtype
unet(lmin l).dwdisplaytype = unetapi(l).dwdisplaytype
unet(lmin l).dwusage = unetapi(l).dwusage
if unetapi(l).plocalname then
llength = lstrlen(unetapi(l).plocalname)
unet(lmin l).slocalname = space$(llength)
copymem byval unet(lmin l).slocalname, byval unetapi(l).plocalname, llength
end if
if unetapi(l).premotename then
llength = lstrlen(unetapi(l).premotename)
unet(lmin l).sremotename = space$(llength)
copymem byval unet(lmin l).sremotename, byval unetapi(l).premotename, llength
end if
if unetapi(l).pcomment then
llength = lstrlen(unetapi(l).pcomment)
unet(lmin l).scomment = space$(llength)
copymem byval unet(lmin l).scomment, byval unetapi(l).pcomment, llength
end if
if unetapi(l).pprovider then
llength = lstrlen(unetapi(l).pprovider)
unet(lmin l).sprovider = space$(llength)
copymem byval unet(lmin l).sprovider, byval unetapi(l).pprovider, llength
end if
next l
end if
lmin = lmin lcount
loop while lreturn = error_more_data
end if
if henum then
l = wnetcloseenum(henum)
end if
loop while llastindex < lmin
if ubound(unet) > 0 then
for l = 0 to ubound(unet)
select case unet(l).dwdisplaytype
case resourcedisplaytype_directory&
debug.print "directory...",
case resourcedisplaytype_domain
debug.print "domain...",
case resourcedisplaytype_file
debug.print "file...",
case resourcedisplaytype_generic
debug.print "generic...",
case resourcedisplaytype_group
debug.print "group...",
case resourcedisplaytype_network&
debug.print "network...",
case resourcedisplaytype_root&
debug.print "root...",
case resourcedisplaytype_server
debug.print "server...",
case resourcedisplaytype_share
debug.print "share...",
case resourcedisplaytype_shareadmin&
debug.print "shareadmin...",
end select
debug.print unet(l).sremotename, unet(l).scomment
next l
end if

changechange 2004-12-15
  • 打赏
  • 举报
回复
1、要看你准备用什么原理实现,他是通过监视网卡封包来实现的, ACCESS 中可以不用这么做,直接写数据到一个共享数据库就可以了
2、不清楚

7,713

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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