好好学习,好好工作,好好生活
终身学习,努力赚钱,健康愉快 注意:转发本blog文章请注明文章出处(http://www.blogjava.net/lusm)谢谢支持!
首页
新随笔
联系
聚合
管理
随笔 - 303 文章 - 883 trackbacks - 0
<
2007年11月
>
日
一
二
三
四
五
六
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
4
5
6
7
8
欢迎光临!
闲聊
QQ:
1074961813
随笔分类
(357)
Ajax、Flex(6)
Blog公告(3)
c/c++/C#/pasic/vb/php/asp(.net)/win-cgi/xml...(53)
database(13)
j2se/j2ee/j2me(142)
kernel (16)
linux configuration(6)
Listening 所有的声音都是音乐(1)
matlab~~~值得一学的工具(2)
network(5)
SUN OS(8)
unix program(10)
书法(欲罢不能,神魂颠倒的美)(4)
入侵反入侵(4)
关于搜索引擎
哲学世界(8)
多媒体开发(4)
嵌入式开发(14)
常用资源(19)
汇编 *asm/at&t ....(1)
科学百科(4)
算法(2)
编程问题(4)
计算机病毒反病毒学(4)
身体锻炼(5)
软件 & 书籍 推荐(19)
我管理的群
j2ee
struts Hibernate spring等学习 基础不扎实 可以跳到j2se学习群 37486623 请先退出该群
j2se(37486623)
j2se学习 若人满请加到12999758 学完的可以跳到j2ee学习群 37486483 请先退出该群
java || .net(50982019)
java & .net都是热门的web技术 当然可以一起学啦 欢迎前来探讨技术 解决问题
java 2(35917927)~~~请加这个
该群在发展中,踢人是经常的事情
java(12999758)
学完的可以跳到j2ee学习群 37486483 请先退出该群
Java应用(14821632)
学无止境 好好努力! 讨论 web 技术 、 Java (j2se j2ee) 、C/S编程 、 数据库 。。。。
Linux C、C++(33318370)
将 Linux 和 C、C++ 编程进行到底!
Think in java(16705375)~~~请加这个
《Think in java》 我们的最爱
国学(111230500)
历史、宗教、哲学、气功、传统技艺,欢迎加入,知无不言,言无不尽!
文祠实习群(32644370)
07年文祠实习群
驱动开发群(27054589)
arm || intel ...platform Windows || Linux device driver development 有一定基础方可加入
公共blog
n维空间
Email : java3d@126.com 群 : 12999758
参与管理的论坛
ineedyou
ourlinux
好友的blog
lyforever
Resplendent技术blog
java、VC和嵌入开发
一梦如是
c/c++/windows/mfc
三驾马车
仙人指路
弄VC和汇编的家伙
吕鑫磊
吴卫-3D工作室
好好学习,天天向上,态度决定一切
同学的blog
廖益花
琦琦
北京的朋友,和我一起创建了不少群 呵呵!
菜菜C++
VC++
陈敏师兄
霍霍
一个和我差不多大的北京女孩
我的其他blog
kernel world(csdn)
寻寻觅觅—— C语言
我的世界 不被打扰
虚拟世界-自由自在
音乐在身边
朋友的网站
china1996.cn
ourlinux.org
ourlinux.org
笑话大全
累了的时候啦 可以寻下开心
搜索
最新评论
1. re: Windows Embedded CE 6.0 下载地址和序列号
评论内容较长,点击标题查看
--码无止茎
2. re: Caused by: java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
评论内容较长,点击标题查看
--一
3. re: linux0.11内核编程入门全集视频下载
博主,看不了啊,方便的话发一份到ren1198997229@163.com 谢谢( ̄▽ ̄)"
--renchunhui
4. re: JVM 、JDK(c/c++)源代码下载[未登录]
还可以吧
--刘勇
5. re: linux0.11内核编程入门全集视频下载
视频怎么下不了啊
--MSM
windows网络编程【001】打印WSAPROTOCOL_INFO -_-!~~~~~~
代码:
#pragma comment(lib,
"
Ws2_32.lib
"
)
#include
<
winsock2.h
>
#include
<
iostream.h
>
void
WSAprint(WSAPROTOCOL_INFO
*
lpProtocolBuf)
{
cout
<<
"
dwCatalogEntryId->
"
<<
lpProtocolBuf
->
dwCatalogEntryId
<<
endl;
cout
<<
"
dwProviderFlags ->
"
<<
lpProtocolBuf
->
dwProviderFlags
<<
endl;
cout
<<
"
dwServiceFlags1 ->
"
<<
lpProtocolBuf
->
dwServiceFlags1
<<
endl;
cout
<<
"
dwServiceFlags2 ->
"
<<
lpProtocolBuf
->
dwServiceFlags2
<<
endl;
cout
<<
"
dwServiceFlags3 ->
"
<<
lpProtocolBuf
->
dwServiceFlags3
<<
endl;
cout
<<
"
dwServiceFlags4 ->
"
<<
lpProtocolBuf
->
dwServiceFlags4
<<
endl;
cout
<<
"
iAddressFamily ->
"
<<
lpProtocolBuf
->
iAddressFamily
<<
endl;
cout
<<
"
iMaxSockAddr ->
"
<<
lpProtocolBuf
->
iMaxSockAddr
<<
endl;
cout
<<
"
iNetworkByteOrder ->
"
<<
lpProtocolBuf
->
iNetworkByteOrder
<<
endl;
cout
<<
"
iProtocol ->
"
<<
lpProtocolBuf
->
iProtocol
<<
endl;
cout
<<
"
iProtocolMaxOffset ->
"
<<
lpProtocolBuf
->
iProtocolMaxOffset
<<
endl;
cout
<<
"
iSecurityScheme ->
"
<<
lpProtocolBuf
->
iSecurityScheme
<<
endl;
cout
<<
"
iSocketType ->
"
<<
lpProtocolBuf
->
iSocketType
<<
endl;
cout
<<
"
iVersion ->
"
<<
lpProtocolBuf
->
iVersion
<<
endl;
cout
<<
"
szProtocol ->
"
<<
lpProtocolBuf
->
szProtocol
<<
endl;
}
void
main(
void
)
{
WSADATA WSAData;
DWORD lpdwBufferLength
=
0
;
WSAPROTOCOL_INFO
*
lpProtocolBuf
=
NULL;
if
(WSAStartup(MAKEWORD(
2
,
2
),
&
WSAData))
cout
<<
"
WSAStartup
"
<<
WSAGetLastError()
<<
endl;
else
{
if
(SOCKET_ERROR
!=
WSAEnumProtocols(NULL,lpProtocolBuf,
&
lpdwBufferLength))
{
cout
<<
"
WSAEnumProtocols: should not have succeeded\n
"
<<
endl;
}
else
if
(WSAENOBUFS
!=
WSAGetLastError())
cout
<<
"
WSAEnumProtocols(1):
"
<<
WSAGetLastError()
<<
endl;
else
{
lpProtocolBuf
=
(WSAPROTOCOL_INFO
*
)malloc(lpdwBufferLength);
if
(lpProtocolBuf)
{
DWORD nRet
=
WSAEnumProtocols(NULL, lpProtocolBuf,
&
lpdwBufferLength);
if
(SOCKET_ERROR
==
nRet)
cout
<<
"
WSAEnumProtocols(3):
"
<<
WSAGetLastError()
<<
endl;
else
{
for
(
int
i
=
0
; i
<
nRet; i
++
)
WSAprint(
&
lpProtocolBuf[i]);
}
free(lpProtocolBuf);
}
}
}
if
(SOCKET_ERROR
==
WSACleanup())
{
cout
<<
"
WSACleanup failed with error
"
<<
WSAGetLastError()
<<
endl;
return
;
}
return
;
}
运行结果:
dwCatalogEntryId-> 1001
dwProviderFlags -> 8
dwServiceFlags1 -> 131174
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 2
iMaxSockAddr -> 16
iNetworkByteOrder -> 0
iProtocol -> 6
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 1
iVersion -> 2
szProtocol -> MSAFD Tcpip [TCP/IP]
dwCatalogEntryId-> 1002
dwProviderFlags -> 8
dwServiceFlags1 -> 132617
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 2
iMaxSockAddr -> 16
iNetworkByteOrder -> 0
iProtocol -> 17
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD Tcpip [UDP/IP]
dwCatalogEntryId-> 1004
dwProviderFlags -> 8
dwServiceFlags1 -> 140809
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 2
iMaxSockAddr -> 16
iNetworkByteOrder -> 0
iProtocol -> 17
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 6
szProtocol -> RSVP UDP Service Provider
dwCatalogEntryId-> 1005
dwProviderFlags -> 8
dwServiceFlags1 -> 139366
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 2
iMaxSockAddr -> 16
iNetworkByteOrder -> 0
iProtocol -> 6
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 1
iVersion -> 6
szProtocol -> RSVP TCP Service Provider
dwCatalogEntryId-> 1114
dwProviderFlags -> 0
dwServiceFlags1 -> 131086
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -3
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 5
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{A0A7169C-1DB9-4D5E-8594-3976D0991E26}
] SEQPACKET 3
dwCatalogEntryId-> 1115
dwProviderFlags -> 0
dwServiceFlags1 -> 131593
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -3
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{A0A7169C-1DB9-4D5E-8594-3976D0991E26}
] DATAGRAM 3
dwCatalogEntryId-> 1116
dwProviderFlags -> 8
dwServiceFlags1 -> 131086
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -2147483648
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 5
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{B626B50F-0244-4460-A218-1D8466D9E7A3}
] SEQPACKET 0
dwCatalogEntryId-> 1117
dwProviderFlags -> 8
dwServiceFlags1 -> 131593
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -2147483648
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{B626B50F-0244-4460-A218-1D8466D9E7A3}
] DATAGRAM 0
dwCatalogEntryId-> 1118
dwProviderFlags -> 0
dwServiceFlags1 -> 131086
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -1
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 5
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{CC8B610C-90B7-46FE-839C-C5427023A576}
] SEQPACKET 1
dwCatalogEntryId-> 1119
dwProviderFlags -> 0
dwServiceFlags1 -> 131593
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -1
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{CC8B610C-90B7-46FE-839C-C5427023A576}
] DATAGRAM 1
dwCatalogEntryId-> 1120
dwProviderFlags -> 0
dwServiceFlags1 -> 131086
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -2
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 5
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{F696A8CB-6643-4958-AF37-E1D74C5C8CA4}
] SEQPACKET 2
dwCatalogEntryId-> 1121
dwProviderFlags -> 0
dwServiceFlags1 -> 131593
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -2
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{F696A8CB-6643-4958-AF37-E1D74C5C8CA4}
] DATAGRAM 2
dwCatalogEntryId-> 1122
dwProviderFlags -> 0
dwServiceFlags1 -> 131086
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -4
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 5
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{27234B9C-EE1B-4417-8044-3E473B55AC57}
] SEQPACKET 4
dwCatalogEntryId-> 1123
dwProviderFlags -> 0
dwServiceFlags1 -> 131593
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -4
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{27234B9C-EE1B-4417-8044-3E473B55AC57}
] DATAGRAM 4
dwCatalogEntryId-> 1124
dwProviderFlags -> 0
dwServiceFlags1 -> 131086
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -5
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 5
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{CDFF07DF-6E82-46BB-A752-240156F6A069}
] SEQPACKET 5
dwCatalogEntryId-> 1125
dwProviderFlags -> 0
dwServiceFlags1 -> 131593
dwServiceFlags2 -> 0
dwServiceFlags3 -> 0
dwServiceFlags4 -> 0
iAddressFamily -> 17
iMaxSockAddr -> 20
iNetworkByteOrder -> 0
iProtocol -> -5
iProtocolMaxOffset -> 0
iSecurityScheme -> 0
iSocketType -> 2
iVersion -> 2
szProtocol -> MSAFD NetBIOS [\Device\NetBT_Tcpip_
{CDFF07DF-6E82-46BB-A752-240156F6A069}
] DATAGRAM 5
Press any key to continue
地震让大伙知道:居安思危,才是生存之道。
posted on 2007-11-24 10:21
小寻
阅读(1300)
评论(0)
编辑
收藏
所属分类:
c/c++/C#/pasic/vb/php/asp(.net)/win-cgi/xml...
新用户注册
刷新评论列表
只有注册用户
登录
后才能发表评论。
网站导航:
博客园
IT新闻
知识库
C++博客
博问
管理
相关文章:
[转][精]windows DDK驱动开发视频
[原创]JACOB语法
[原创]浅析JACOB
[转]在Ajax应用中自定义脚本时出现"Sys未定义"的错误。
nhibernate 视频教程和代码 下载
eWebEditor 'ContentFlag' 未定义错误 分析解决
如何在C#.net中编写和使用DLL文件 [代码+ppt+视频讲解]
C# .net 报表控件(reportViewer) [代码+视频讲解]
C# .net ajax 户籍查询系统 [代码+视频讲解]
C中的指针